One shot pan vst

Like @simon said, GP script could help.
You can take a look here, just connect the MASTER widget to the pan of for example the GAIN Plugin connected after the plugin which produces your train sound:

Automatic Fade Out