It would be heavy as well in today's tech.You are absolutely right. But the timeline is too soon. I doubt it will come soon within the lifetime of existing hulls. The first gen rail could be equipped, say, a decade later. By then the doctrine could've been developed beyond recognition. If we still need 4000-ton class ships doing what a current ship's been doing, then the railgun/coilgun needs to be made smaller and lighter. IMHO because the weapon system change is so vast, it will drive changes at the root of Navy. What types of ships will be produced is the result of that change so it is unknown at this point.
On the other hand, people are saying the railgun/coilgun is voluminous but not heavy.
Professor Ma's design is based on battery and supercapacitor. Battery is probably heavier (density) than chemical explosives in the gun shell put their magazin. Supercapacitor in today's construction seems not be much ligher either.