They know where the trains are headed. And you can just go up and ask them. And, generally, if they know, they'll tell you. When you're wandering around a yard, you'll find the crews, the switchmen and the car-knockers. Train crews are helpful, but they usually only know where their trains are going, and even then, only at the last minute.
Switchmen know only where some of the trains are going.
The people who know the most about train movements are the car-knockers. Those are the folks who drive around the yard in little ATVs, hooking up and inspecting the trains. Car-knockers usually have their own headquarters with a dispatcher sitting in front of a terminal. The dispatcher usually will tell you anything you want to know about the arrival and departure of incoming and outgoing trains. Those guys have pretty thankless jobs.