Have you given any thought to using "focus stacking" for an image like this?
I would put the camera on a tripod, and then set up about 6-7 shots with the focus point varied in each one. For exampe:
1 - on headlight
2 - cab door of lead
3 - rear of lead
4 - center porthole of first B unit
5 - coupling between first and second B unit
6 - coupling between second B and trailing A unit
7 - cab door of rear A unit
8 - lead or 2nd car in train
Then... use focus-stacking software to "combine them" into a single image.
The software will examine each image, keep the "focused area", and discard the rest.
End result -- all images merged together, and much more "in focus".
For an example, see here: