It isn't only that, with a powder charge you are pushing the projectile with an explosion. That explosion will also cause a disturbance on a ship, until you get to a pretty enormous size, you have to calculate that into your trajectories. With a railgun, you have a series of magnets pulling a projectile forward incrementally faster. It's a lot less energy wasted into the environment, meaning a lot less energy put back into the ship. These larger guns could be put on smaller ships and calculated with greater accuracy with greater ease due to less wasted energy put back into the ship and gun, I'm guessing.