In this scenario I would use a light beam activated remote shutter control. This is a device consisting of a beamed light source (typically a laser or a LED and a photo sensor). As soon as the beam is broken by an incoming object, the shutter is triggered.
Warning! Since you have to place the trigger in the path of the train it might be tempting to step onto the tracks. This is very dangerous and in many (all?) countries this is illegal and punishable. I do not encourage anyone to break the law. Either you try to get a permission from the authorities (probably very unlikely, considering the danger involved) or you need to beam the trigger from one side of the tracks to another, without trespassing the tracks themselves. Given that you use a trigger with long enough range and preferrably also a laser (a LED are likely to show up in the shot) and have a crossing nearby to get you to the other side you'll be fine. Of course this might still be illegal to do in some countries and if so you'll just have to come up with something else.
Set up your gear when there is still enough light to comfortably lock focus at the point where the train will cross the beam and you're set. If focus carfully you can use a very large aperture, letting in more light and get a shallow depth of field if that is what you're looking to capture.
By using this setup you can take some photographs without the train to ensure that the exposure is spot on and when you're ready just wait. If you're photographing at dusk and the light is constantly changing you just have to keep evaluating the scene with more test shots.
As long as everything is set up perfectly you just have to take one photograph and there is no need for bursts of photos or autofocus and it will still turn up great.