what extent AND type of the damage do you expect to be inflicted upon a modern (=unarmored) warship by a single hit off a 32 OR 64 MJ railgun (presumably shooting around-5"-caliber metal rods)?
I now checked the kinetic energy of a hit by Mk 7 16" at its max. range had been
0.5*1225*514^2 (don't nitpick if I didn't read out at navweaps.com the striking speed correctly, if it's incorrectly quoted there, or anything)
which is about 162 MJ; I don't try to mix apples with oranges: the main point of hitting by a 16" shell of course wasn't its kinetic energy, but the main point was to deliver several tens of pounds of an explosive under the deck of an enemy ship, and blow up said explosive there (actually if the fuze wasn't set off, the damage made by a large-caliber shells wasn't much worse than just holes in the bottom, as it had been happening in the action of the Yamato against the Gambier Bay, an unarmored escort carrier)