Please disregard what I stated previously.
A railgun can achieve very high muzzle velocities because of the constant acceleration that is achieved. Meaning, that, the longer the barrel, the higher the muzzle velocity will be.
If you were looking for a few formulas :
F = ma ; F -> force generated by magnetic field.
.; m -> mass of projectile
. ; a -> acceleration of said projectile due to F
then v = sqrt(2*a*x) ; v -> muzzle velocity
. ; a -> as above
. ; length of barrel
This is all assumed that you will only use 1 pair of rails. I don't know the mathematics behind more than 1 pair. To me it seems though as if it scales linearly, which can't be right.