That machine is actually designed to do that:
"Cartopper™ Materials Handler
The versatile Cartopper self-mounts from the
ground to an operational position in less than 10
minutes – it also dismounts without assistance.
The Cartopper then rides along top of the
railcars, moving from car to car, loading or
unloading onto or from the right-of-way as the
work train moves along the track."
........as shown at this site, several pages down:
www.herzog.com/herzog%20brochure.pdf
Very fascinating, none the less.