Is there any kind of technology similar to ADS-B for trains? I'm aware of HOT/EOT/DPU messages, but as far as I can see these don't allow you to see its location. I'm specifically wondering about the location aspect. Would be particularly nice if I could pick it up with my RTLSDR!
Yes, there is a technology used by trains for location -- or more correctly, there used to be. Back in 1985/1986 timeframe, our company licensed a large software system used to implement large-scale, real-time control systems, to a company (Harman Industries) out of Kansas City whose business was building such control systems for trains.
The system used transponders and fixed locations with satellite comms -- this was NOT GPS, in fact, this predated GPS. The advantage that train location had was that the system actually always knew which track the train was on and they new where the track runs across the country side. The train would pass a known location (e.g. signal tower, switching track, etc.) and then communicate that location whose status would find its way back to the control system that would affect signals and switches on the tracks.
The long-haul trucking industry also uses transponders for location management.
Today though, I think everyone uses GPS. The other day, I used GPS to find my wife who was photographing birds in a wildlife refuge. We were briefly separated and I used FriendFinder on my iPhone to track her location.