I mention this above in my own comment, but a railgun would instantly vaporize the water it comes into contact with. If you look at the footage and pictures of the US Navy's railgun tests you will note fire around the weapon barrel when it is discharged. Railguns don't use explosive propellant, that is the AIR catching on fire from the friction against the projectile.