I think rail guns and fusion reactors are in the same category: working on it, but we're missing a specific piece of information.
Rail guns need a lot of power and the capacitors are slow to charge. Fix those issue and it's probably viable. The US proved it was a powerful weapon that is accurate, and can be mounted on a ship. Problem is that the rate.of fire was minutes between shots, where current warfare says that if you don't have an x/min fire rate, you dead.
Don’t understand fusion enough to say what's the knowledge gap but again it's one of those things that aren't viable yet but we are close.
This was an informative watch: https://youtu.be/qqhXsUwncfE
Basically, the tech isn’t there to power it, and also the “barrel” breaks down way faster than traditional guns