The Transit app crowd-sources this from users who are using the "Go" feature in select markets.
There's also the Tripshot model -- an enterprise product where drivers install an app on a cell phone to track ridership, and it also sends the gps coordinates along.
That said, the other arcane part of transit directions is that if you update or break your feed, you have to wait hours or days before the result shows up on Google. (Sigh, batch processing...)
You know you can request Google scrape your 'static' feed at any interval you like, down to 10 minutes IIRC? Contact the maps-transit team with your feed URL and they'll update it for you.
They only scrape daily by default because some transit providers host their multi-gigabyte GTFS feeds for all bus arrivals for the next century on an ISDN line...
Transit is also run by a bunch of transit geeks, who also invest a lot of time in getting local knowledge and fixing feeds. Just a simple example, they will add colors to the transit lines in a feed, so that in the app they show up the same way as on maps etc.
A major issue with relying on drivers is that if the real-time position of a driver is known, you can see both what they're doing and what they're not doing. Which is bad if you want to get away with, say, taking longer breaks than you're supposed to.
Anecdotally, at a local system I once used there was an issue where drivers were intentionally not turning on the locating tracking, or configuring it incorrectly, because of this.
There's also the Tripshot model -- an enterprise product where drivers install an app on a cell phone to track ridership, and it also sends the gps coordinates along.
That said, the other arcane part of transit directions is that if you update or break your feed, you have to wait hours or days before the result shows up on Google. (Sigh, batch processing...)