No, it's not true. But to find a counterexample you have to use some test other than the M-test to prove the uniform convergence. That probably means using the uniform version of the Dirichlet or Abel tests for convergence. A typical counterexample is the series on the interval [0,1]. This converges uniformly by the uniform Dirichlet test. But and does not converge.