Well, a very fast moving railgun projectile will quickly lose its kinetic energy on impact with the surrounding water- making for some pretty spectacular bubbles, I'd bet.
But I am more worried about the cannons shorting out from contact with seawater- the rails have to be in contact with the bullet, and the bullet must be in a barrel open to the outside, thus water will probably get in there, the rails are charged up with a high-voltage high-amp current during firing, and water conducts electricity... which will make a short-circuit at the very least, and water in the barrel will resist the firing of the projectile. The railgun would probably explode. If these guys have built water-proof railguns that fire supercavitating bullets, yeah, it probably could work, just like underwater firearms do.