Depends on what it's mounted on. I think ships will have rail guns, but fighters/bombers will likely have directed energy/laser weapons on board before they have railguns. Railguns need ammunition as well as power, where as the energy weapons, power is the ammunition, so its more or less just the fuel on board the plane which will be converted into ammunition.
There will be combinations of rail and laser/energy weapons in all branches eventually. I do think that small arms will transition to a caseless or cased telescoped ammunition made of polymer, which will make the weapons 1/2 the weight, and the ammo even lighter, with more capacity. I don't think infantry rail gun weapons are in the near future, or even armored vehicle rail weapons, the electric power needed is still to large scale to fit on a vehicle IMO.
Rail guns still need to scale up in power, and down in size, before they can be used in everything.