You are correct that molecule mobility depends on the mass-to-charge ratio, and this means that different sized molecules with the same $\frac{m}{q}$ will have the same acceleration. However, the velocity of a molecule moving through a gel matrix depends on the point at which the force exerted by the electric field is in equilibrium with the frictional forces acting on the molecule. Modeling different sized molecules as spheres of different sizes, we can apply Stokes' Law:
$$F = 6\pi \mu Rv$$
where $\mu$ is viscosity of the matrix (constant), $R$ is the radius of our molecule, and $v$ is the flow velocity. Rewriting your equation, we see that
$$F = qE = ma = 6\pi \mu Rv$$
and
$$v = \frac {ma}{6\pi \mu R}$$
For constant $a$ and $\mu$, velocity varies with the ratio of mass to radius
$$v \sim \frac{m}{R}$$
Assuming uniform density ($d = \frac{m}{V}$), the radii of our model spheres scales cubically with their mass ($V = \frac{4}{3}\pi R^3$), meaning that $\frac{m}{R}$ decreases as molecule size increases.
So, larger molecules will reach force equilibrium with the opposing frictional resistance at a lower velocity compared to smaller molecules, thus explaining how different sized molecules with the same $\frac{m}{q}$ will separate on a gel. One caveat to this explanation is that polypeptides and nucleic acids are poorly modeled by spheres, and that the mass of such molecules scales linearly with length.