Note: this is a question about railway - mounted artillery, NOT about armored trains (which were more akin to tanks-on-rails and had much smaller guns)
The idea behind railway gun is quite sound: a bigger gun is better than a small gun but it is harder to relocate. But if we will use trains, that can carry lots of weight relatively quickly, then we can put REALLY BIG guns on them and move them around with ease!
But the effect is far from expected because the railway artillery requires LOTS of maintenance and logistics, might have problems with aiming in other direction than straight ahead of the tracks and the number of shots per day is simply pathetic:
For example, the famous Dora (no, not that one) required 250 people to assemble the gun in 3 days, 2500 to lay the tracks and 2 flak battalions to protect it from the air attacks and in return, it was providing 14 shots per day.
All this looks horribly inefficient when compared to for example WW II bombers or even smaller, WW I heavy artillery, like the famous Big Bertha (which could fire 8 shots per hour, although indeed with ~7 times lighter shell).
So, were ever those "white elephants" of modern weapons even critical in winning any battle? Or were there just a drain on the resource, that could be better spent on a different kind of weaponry?
I've removed the "winning" part since indeed it had not much sense - U-boats were critical in the battle of Atlantic, yet the battle was won by Allies. So in other words, I am looking for battles where railway guns have played a very significant role, no matter on the final outcome.