Sounds like some old motor generator set that’s older than dirt, and maybe older trains needed (need?) the low frequency to run special slow synchronous motors. Just a guess... today, if trains can deal with multiple frequencies, it would of course make sense to tie it directly into the utility with transformers and have it be 60 Hz.
Anyway, the history I learned was that a most trains had standardized on large DC commutator motors, which could also be used in AC. Problem was, the higher the frequency, the more internal inductance problems you had. 25 Hz was a good compromise between internal inductive loss and transmission loss on the line.