When train cars are linked together{coupled} it was much like a trailer hitch, but instead of a ball hitch, there was a pin hitch. The man who aligned the hitch and dropped in the pin was sometimes referred to as the "Pinhead" .
I'm not sure if this may be a mechanized operation these days.