>>13229216A railgun doesn't really do anything any better than large bore cannons are capable of. High velocity is neat, similar effect is achieved with sabots. Small projectiles lose speed faster, limiting damage and range to ultimately not be any different than old beyond the horizon WW2 15/16 inch naval artillery. Missile defense has essentially been a solved problem since AEGIS, phalanx, sea sparrow/RIM, and the SM2 most of which have existed for almost 50 years.
Modern war engineering has moved away from heavy armor on ships because missiles do the job of expensive huge cannons that basically accelerate a boat's structural failure. Seriously, no boat since the Korean war has ever had the amount of armor pre- and WW2 navies used.
Railguns are cool and all but the electrical demand to have a missile equivalent projectile is absurd, the size would be immense, and modern sea combat is based on detecting and removing threats before an artillery piece (a railgun is just fancy arty) could be in range. Railgun does nothing better than a good missile platform.