This is not an answer to the question, but a proof of something much weaker: there is a sequence $c_m\to0$ such that if $\lVert g_m\rVert\leq c_m$ for all $m$, then the result from the question is true. The growth of $c_m$ could be estimated if we had bounds for the constants $a_{m,i}$ and $k_m$ from below; I don't know if there are proofs of the Stone Weierstrass theorem including those bounds.
First note that for all $m$, the functions $x^m,x^{m+1},\dots$ generate a dense subspace of $C([1,2])$, as for any $h\in C([1,2])$ we can approximate $\frac{h(x)}{x^m}$ arbitrarily well with polynomials.
Now let $(f_m)_m$ be a sequence of continuous functions dense in $C([1,2])$. For each $f_m$, by the paragraph above we can obtain finitely many constants $a_{m,m+1},a_{m,m+2},\dots,a_{m,m+k_m}$ such that
$$\left\| f_m-\sum_{i=m+1}^{m+k_m}a_{m,i}x^i\right\|_\infty<\frac{1}{m}.$$
So, if we consider a decreasing sequence $c_m$ such that $c_m\left|\sum_{i=m+1}^{m+k_m}a_{m,i}\right|\to0$, then $\lVert g_m\rVert<c_m\;\forall m$ implies that
$$\left\|f_m-\sum_{i=m+1}^{m+k_m}a_{m,i}(x^i+g_i(x))\right\|_\infty\to0,$$
so the subspace of $C([a,b])$ generated by $x^i+g_i(x)$ is dense in $L^2$, proving that $f=0$.