While I kind of agree with your point on the rail gun, manned aircraft loitering in any modern battlefront are essentially doomed. Anti aircraft missiles are a lot more effective and a lot cheaper with modern computers.
This is, incidentally, why the A-10 is obsolete. Trying to fly slow and low on a modern battlefield is indeed doomed. During the Gulf War, F-16s performed more CAS missions than A-10s did because the A-10 was simply not survivable against modern threats. To the extent they had to be withdrawn from known Republican hot zones because the danger was simply too great.
I imagine it differently: lasers will make jets resistant to AA warfare, they potentially can shot down any incoming missile very efficiently.
I think one of the Navy's biggest issue is railguns pretty much make large surface ships a detriment and they are very loathe to give up their carriers. Those are their "balance in importance" versus the Air Forces stealth bombers and missiles. The Navy has lived off its success since WW2 for far too long with this need for 10 full CV forces.
(Plastic doesnt show on x-rays.)
If you could fit a multi-kilowatt laser on an F-35, and make it a practical thing (so no expendable chemicals being used up every shot, no having to gut air frame to fit all the laser equipment) it could radically alter how America fought its wars. Imagine a dozen F-35s flying over a combat zone, and killing individual enemy soldiers with literal laser precision - unlike with conventional munitions they can keep doing that for as long as their fuel supplies last. The sustained support laser-equipped planes could provide to ground forces is kind of amazing/terrifying when you really think about it.
Contrast the rail gun. The primary naval weapon is missiles, whether launched by plane or by ship. Guns are secondary (tertiary if you count torpedoes) equipment, mostly used for warding off pirates or shooting down enemy missiles while they're coming in. The rail gun offers to replace the rarely used 5 inch gun on most destroyers with...a longer range gun that's also going to be seldom used. The original idea of using it for "shore bombardment" or that it can be a backup weapon for when the missile magazines run dry are both...kind of dubious ideas now that we're facing a resurgent China and Russia who aren't going to allow our ships to close to within rail range before destroying them with their own missiles.