Oh, they’re a bit more than “longer ranged.” Like 100+ miles, vs. the more common 13-15 miles now possible from the commonly-used gun/munition combinations currently used.
Solid shot aren’t cheap, but they’re a lot less expensive (and more reliable) than chemical warhead shells - They have no moving parts, and are essentially machined hunks of alloy. Still not pocket change because “high-tolerance machined alloy.”
7 seconds to the horizon is VASTLY more fast that current munitions. There are multiple reasons ship-to-ship cannon fire misses at anything over short range, and that’s because the target moves between the time you fire and the time the shell arrives - Good prediction computers help a lot there, but reducing the time available for errors to accumulate is always a massive bonus to accuracy.
In fact, the speed of the current prototype rail guns (Mach 7+) is so fast that the shells are credible antiaircraft weapons even without fragmentation warheads. If they manage to perfect fragmentation warheads (and I can guarantee they’re working on it!), the cost per shell goes up, but the lethality expands exponentially.
The kinetic energy transfer on a hit is violent: clouds of burning metal fragments, secondary fragmentation, shock damage, and more. Plus you can count on this happening in multiple compartments and spaces - It may not be as physically impressive as a bomb, but systems & mission kill will do the job just fine.
Missiles and gun systems are complementary. One is relatively short range, fast-response, and cheap. The other is slower, longer-ranged, and expensive.
Everyone is fascinated with the old battleships and their armor, but big==bigger target; armor is obsolete with the advent of aerial combat aviation. Railguns will only add to that, though it’s really not a question that will ever come up in the real world.