Bad Day at Black Rock with Spencer Tracy has shots of him both getting off and getting on a single unit diesel passenger train. Also, the 1940s B&W one where the big time producer (O Malley's Journey?) goes out into the world with no $$$ in his pockets has a plot line in a mammoth switching yard with myriad tracks to try to cross in front of a train coming. Joel McRea is the hero.