I see a switch for these on many US engines, but where are they on the loco and what are they supposed to be used for?
They are the two headlights mounted just above the frame rail. They have been required as a safety measure since the 1990s- without functioning ditch lights, a train is limited to 20 mph on any line which has grade crossings (which is all of them) and is required to stop for repairs at the next depot. The major exception is switchyards- within yard boundaries ditch lights must be turned off, to avoid blinding workers (those suckers are bright).
On the ACS-64, they are the white lights next to the taillights (the actual headlights are above the cab window :P) When you sound the horn, look at the front of the loco and watch the ditch lights flash (left right left right)
Depends on the railroad. Speaking broadly, flashing ditch lights are an eastern US thing; in the west and Canada they stay steady (TSW doesn't always get this right).
Its also worth noting that trains parked in siding will usually have them off (as well as lights dimmed) to avoid blinding the crew of an oncoming train.
The Southern Pacific did have flashing ditchlights, a few Ex-SP AC44's on UP's roster still have them equipped. The Burlington Northern also had flashing ditchlights on their Executive MAC's as well
I was watching a stream by the guy who helped DTG with signalling and the Acela set up and references and he said that, all American passenger trains/locos have their headlights set to Dim whenever stabling at a station like New York Penn or Boston South station. Is this common for passenger train operations?