With railguns, most of the recoil is actually perpendicular to the direction of the projectile, trying to force the rails apart in both directions. If the rails are bound to each other, the forces net against each other, and basically there is no recoil.
That is a violation of the law of conservation of momentum. True, there are forces acting sideways trying to bend the rails out, but there is a force trying to shorten the rails, as well. The gun cannot push the projectile forward without the projectile pushing back on something.
This is not like RPG where the projectile has a rocket driving it forward unless you have vaporized metal moving in the opposite direction as the projectile.