I know here's a temptation to build them, there's something intimidating in this game about being the player with more range and no one likes to take fire without returning fire so having railguns creates a situation where that almost never happens to you. But really they are awful. Fools gold at best. The people who build them are not playing to win they are trying not to lose. You can't use them on offense because it takes too long to build a railroad (3 days wait after every province) they move too slow, they can be immobilized trivially easily and faster units can always flank them. They don;t have so much firepower that running them over is out of the question either. People seem to love them but really they are mostly building a unit that won't help them win, it just helps them be annoying to kill. The resources and factory time are huge opportunity costs for a unit that basically will be left behind if you're winning and won;t change much about the outcome if you're already losing.
the almost all the time part is two fold. sometimes the geography of a certain part of the map lends itself favorably to rail guns, if you start on an island it can help to keep battleships away but the real answer there is to have your own battleships which can also go on the offensive. They can also sometimes change the dynamics at the suez canal on the 100 player map.
there's one more time where railguns are pretty strong. If you're spending 3M+ GM to try and win a game then building 50 railguns and instantly building a railroad in every province you take gets rid of much of the speed penalty for having railguns. I'm in a game now where one guy dropped $1400 on GM and even after we killed 20 of his fighters, 15 of his rail guns and 30 of his bombers he just built 150 more planes and 30 more rail guns. With enough GM rail guns are basically unstoppable. I don't know why he bothered to buy 40 heavy tanks no one can get near his stack.