Rail guns are first and foremost shore bombardment weapons. Also, the Zumwalt class, the only ship which could realistically carry a rail gun in the short to medium term, carries those big 155m AGS cannons primarily for the purpose of shore bombardment, just as the Zumwalt itself was designed primarily for littoral operations, including shore bombardment. The rail gun's antiship, antiair, and antimissile functions are theoretical and secondary to their primary purpose of destroying land targets quickly, accurately, cheaply, and at long range. This boom stick if it gets put into operation will function primarily as intended, whether or not any of those other functions pan out. Mainly because it's the easiest to implement.
Just because that's how the USN wants to use rail guns is by no means any indication that that is the primary purpose of the technology.
Shooting at targets on land is essentially no different from shooting at targets at sea. Shore bombardment is no more easy than ship engagement in terms of rail gun technologies. The big difference is the precieved operational need and risks associated with getting into position to use rail guns in the desired fashion.
The USN is primarily looking at shore bombardment because it is the world's biggest and most powerful navy by a long way, so do not really expect to have any difficulty in bludging any other navy to destruction the 'old fashioned' way with massed long range missile and air strikes.
The PLAN, being the far smaller navy, would be far more interested in focusing on how to leverage new tech to overcome the numerical superiority of established naval powers.
I don't think any navy ever intended or ever intends to put rail guns on small ships like corvettes or frigates, who in no way will have the ability to power those weapons.
That is more to do with the limitations of technology rather than a lack of desire. Present any navy with a miniature railgun and power source small enough to mount on Frigates and you will see entire new generations of frigates designed to mount them very quickly, as well as vast resources developed to developing tactics and strategies to make the most use out of them.
There is also no reason to use rail guns "aggressively". They can leisurely bombard shore targets from several hundred km away, exactly as they were intended to be used.
Again, that is only looking at things from the prospective of the USN, who has the numbers to whittle down enemies at range, so can afford to sit back to take minimal risks.
Naval weapons development has always been a case of an arms race been spear and shield. Currently, the shield is winning, but rail guns could be one of the technologies that could break that balance and tip it in favour of spear again.
Current generation of AA DDGs can defend against swarm attacking conventional AShM attack with a very high degree of probability of success almost to the point that munitions load would be the primary limiting factor.
The USN doesn't really care, because it has the numbers to pretty much always turn up with more AShMs than the enemy has SAMs, so can win by default.
But for anyone who does not enjoy that sort of overwhelming numerical advantage, they will need to be more innovative.
Here is where rail guns can become a game changer if used aggressively.
You mount rail guns on the smallest, fastest ships you can put them on, use the rest of your conventional fleet to protect them from enemy air and AShM attacks until those line breakers can get within a few hundred NM of the enemy fleet, and they can use those rail guns to devastate the enemy fleet.
Any antiair/antimissile use of a rail gun will be limited to WVR engagements.
No reason why it has to be. If anything, using co-operative engagement with rail guns should be considerably easier than with missiles because of the speed advantage of rail guns, meaning your off board sensor asset does not need to keep the enemy painted as long.
Clearly the largest combatant ships like the cruisers would be the natural home for these rail guns.
Why would that be if you remove the technological bottleneck with the size of the rail guns and the power source issue from the equation? Remember, combat is always a two way street against peers or near-peers. If you can shoot at them, they are shoot right back at you.
If you put rail guns on cruisers while the opponent put rail guns on frigates, your cruisers will need to be at the vanguard of the fleet to engage those frigates, hardly an ideal trade.
Regardless, I don't think these weapons are going to be used in close quarters slugfest engagements. I don't think any modern engagements between advanced navies will end up in close quarters except in utterly rare circumstances.
That wI'll only be the case if it's a far more powerful navy bullying a much smaller one.
Even today, if two similarly matched navies, like the UK RN and French navy, were to engage in a major fleet action against each other, they will probably run out of AShMs before the enemy runs out of SAMs, and not be able to inflict much significant damage to each other before running out of AShMs.
If they wish to continue the engagement and bring about a definitive outcome, they will have to close to within gun range and do things the old fashioned way.