I would like to think that your cat would have enough sense to avoid a railway line with all the noise and vibration, but they do manage to get themselves into some seriously stupid situations.
Brought up in a house very near a railway and we always kept cats who roamed freely. Never had a problem - except that Sandy would regularly bring home baby rabbits from the railway bank.