Let $d$ be a positive integer. Let $f(d,a)$ be the number of values of $x$ in $[1,d]$ such that $$x^{a}\equiv 1\pmod{d}.$$ I wanted to know if for some $0<\epsilon<1$, we can prove the following bound on the sum $$\sum_{i\mid\lambda(d)}\frac{f(d,i)}{i}\ll \lambda(d)^{\epsilon}$$ where $\lambda(d)$ is Carmichael's lambda function for almost all $d$. I found a resemblance of my question with Theorem 6 in this paper but couldn't translate those results to my setting.
Thanks in advance for any assistance.