Railgun tech isn't there yet, the bottleneck is currently what's bottlenecking a lot of higher tech, and that bottleneck is energy generation, storage, and consumption, so that's why we don't see more railgun and laser based tech.
Longest range cannons we had while they were in service, but yeah, rockets and such go further. Would have been interesting to see what partially self-guided and rocket-assisted shells in Battleship size could manage though.
What with the advances in guided and rocket-assisted artillery lately, I am unironically (and, considering the sub, I should also say credibly) convinced that there will be a naval gunnery renaissance in the next couple decades.
Not only that, VLS cells can't be reloaded at sea, you have to go into port for that. Artillery shells don't have that problem.
I also wonder how well anti-missile systems would work against artillery. I think it's feasible to have some artillery on board vessels as a secondary to fall back on after spending all of the anti-ship missiles. Or you could fire the artillery alongside missiles to increase the variety of threats the target has to respond to.
Massive, inaccurate guns just aren't relevant to warfare anymore. A Tomahawk missile can hit a target with high precision and comparable payload at 50x the range of the Iowa's 16 inch guns. And for sustained bombardment, Arleigh Burkes have 5-inch guns that can fire 20 rounds a minute.
As part of their modernization in the 1980s, each of the Iowas received a complement of eight quad-cell Armored Box Launchers and four "shock hardened" Mk 141 quad-cell launchers. The former was used by the battleships to carry and fire the BGM-109 Tomahawk Land Attack Missiles (TLAMs) for use against enemy targets on land, while the latter system enabled the ships to carry a complement of RGM-84 Harpoon anti-ship missiles for use against enemy ships. With an estimated range of 675 to 1,500 nautical miles (1,250 to 2,778 km; 777 to 1,726 mi)[103] for the Tomahawks and 64.5 to 85.5 nautical miles (119.5 to 158.3 km; 74.2 to 98.4 mi)[103] for the Harpoons, these two missile systems displaced the 16-inch guns and their maximum range of 42,345 yards (38.7 km; 20.9 nmi)[36] to become the longest-ranged weapons on the battleships during the 1980s; the ships' complement of 32 Tomahawk missiles was the largest until the Mk 41 VLS-equipped Ticonderoga-class cruisers entered service.