If you want to do it with l'Hôpital's theorem, it's better trying first with
\begin{align}
\lim_{x\to0}\frac{\log(1+xa^x)-x}{x^2}
&\overset{\mathrm{(H)}}{=}\lim_{x\to0}\frac{\dfrac{a^x+xa^x\log a}{1+xa^x}-1}{2x}\\[2ex]
&=\lim_{x\to0}\frac{a^x(x\log a-x)+(a^x-1)}{2x(1+xa^x)}\\[2ex]
&=\lim_{x\to0}\frac{a^x}{1+xa^x}\frac{\log a-1}{2}+
\lim_{x\to0}\frac{1}{2(1+xa^x)}\frac{a^x-1}{x}\\[2ex]
&=\log a-\frac{1}{2}
\end{align}
Just note that $\lim_{x\to0}(a^x-1)/x=\log a$ is the derivative of $x\mapsto a^x$ at $0$.
Thus
$$
\lim_{x\to0}\frac{\log(1+xa^x)-\log(1+xb^x)}{x^2}=
\lim_{x\to0}\frac{\bigl(\log(1+xa^x)-x\bigr)-\bigl(\log(1+xb^x)-x\bigr)}{x^2}
$$
which is $\log a-\log b$.
Without l'Hôpital,
$$
\lim_{x\to0}\frac{\log(1+xa^x)-x}{x^2}=
\lim_{x\to0}\frac{xa^x-x^2a^{2x}/2+o((xa^x)^2)-x}{x^2}=
\lim_{x\to0}\left(\frac{a^x-1}{x}-\frac{a^{2x}}{2}\right)
$$
Motivation. Why trying with $-x$? Because of the symmetry in the given limit and because $\log(1+xa^x)\sim xa^x-x^2a^{2x}$, so subtracting $x$ gives a second order infinitesimal.