Here is a proof that its at most $\exp(O(\log Q\log\log\log Q/\log \log Q))d(n,Q)$, which suffices for the paper.
Let $S(n,Q) = \{q<Q: q|Q\}$$S(n,Q) = \{q<Q: q|n\}$. Clearly $|S(n,Q)| = d(n,Q)$.
Now consider $q<Q$ with prime factors in $A$. We define $q'=f(q)$ to be the maximal $q' \in S(n,Q)$ such that $q'|q$ (clearly $q'$ is well-defined as $q<Q$).
We now claim that $|f^{-1}(q')| \le \exp(O(\log Q/\log\log Q))$ for each $q'\in S(n,Q)$. Let $A'$ be the primes dividing $q'$. Since $$Q> q' \ge \prod_{p \in A'}p,$$ we have $|A'| := k' \le (1+o(1))\log Q/\log\log Q$ by PNT.
We next observe that $|f^{-1}(q')|$ is upper bounded by the number of $q<Q$ with prime factors in $A'$. Letting $P_1,\dots,P_{k'}$ be the $k'$ smallest primes, the number of such $q$ is bounded by the number of $i_1,\dots,i_{k'}\ge 1$ such that$$\sum_j i_j \log P_j < \log Q.$$
But this at most the volume of a $k'$-dimensional unit simplex with the $j$-th axis scaled by $2\log Q/\log P_j$. The volume of the unit simplex is $1/k'!$ and the determinant of our scaling is $$D =\exp(k'(\log(2)+\log \log Q) - \sum_j \log\log P_j)\le \exp(k' +k'\log\log Q) .$$ If $k'<\log Q/(\log\log Q)^2$ we are done since $1/k'!<1$. Otherwise, we have $1/k'!\le \exp(-k'(\log k'-2))$ for all large $k'$ (Stirling's approximation), so here $D/k'! \le \exp(3k' + k'(\log\log Q-\log k')) $. Since $\log\log Q -\log k'\le \log\log \log Q$$\log\log Q -\log k'\le 2\log\log \log Q$ (for our range of $k'$ we are done.