$\tau(n) \le k$ implies that $n=\prod_{i=1}^j p_i$ with $j\le k$, thus $$\sum_{n=1,\tau(n)\le k}^\infty n^{-s} \le (1+\sum_{p \ prime} p^{-s})^k=\sum_n a_k(n) n^{-s}$$ (a coefficient-wise bound) $1+\pi(x)=O(x/\log x)=O(\sum_{n\le x} 1/\log n)$ and $x/\log x=O(\pi(x))$ imply that $$f_k(x)=\sum_{n\le x} a_k(n) =\sum_{n\le x} \frac1{\log n}f_{k-1}(x/n)$$ $$=O(\sum_{n\le x} \frac1{\log n} \frac{x/n}{\log x/n}(\log \log x/n)^{k-1})=O(\frac{x (\log\log x)^{k-1}}{\log x})$$