Baker's theorem implies that
$$ |\log (A/B)| = |\sum e_i \log p_i - \sum f_j \log q_j| > \max (e_i, f_j)^{-C} $$
where $C$ depends only on $\{p_i\}, \{q_j\}$. Since $A \leq \left( \prod p_i \right) ^{\max (e_i)}$ and $B \leq \left( \prod q_j \right) ^{\max (f_j)}$ it follows that $\max (e_i, f_j) \sim \log (\max (A, B))$. Assume for convenience that $A > B$. Then
$$ A/B - 1 \geq \log (A/B) \gtrsim \log (A)^{-C} $$
It follows that $|A - B| \gtrsim \log (A)^{-C} A \gtrsim A^{1-\epsilon}$ for all $\epsilon > 0$. Picking $\epsilon < 1 - d$ we get $|A - B| > A^d$ for sufficiently large $A$.