So how do you use this service to find whats working on a service?
There's various systems Network Rail and the TOCs/FOCs use to manage/track trains - TRUST (Train Running Under System TOPS), Genius (used for passenger workings primarily) etc.
Some of this data is 'open access' and feeds can be obtained from NR and used by the public, provided it's not sold on. Various clever computer folk then use this data in websites like the one
@chrisncal54 linked to, the Data section on Railcam, Open Train Times etc etc. The boffins (usually enthusiasts with far better IT skills than me!) set up code to cleanse it from the raw data that comes out of the system and translate it into something useable for everyday folk like me. It's just then a case of going on to these sites and searching for the various info using various search criteria depending on what you've got to go on (e.g. loco ID, location, headcode, scrambled headcode).
RTT uses the same data feeds - although it uses it specifically for the train running times and overall operating info, rather than providing loco IDs.
The information as to the actual locos on a given working can be a bit sporadic, as relies on various info being put into TOPS 'correctly' by both humans and other systems, and sometimes this is wrong, or not put in. "Downloads" from TOPS to some of these public access websites are done periodically and not "live" - so sometimes you'll "miss" a working if it was operating between downloads, but can sometimes work out what the loco is by where it was and where it's ended up. Some sites like Railcam also have the option for users to supplement the info by inputting locos they've seen etc. - this obviously has some risk of inaccuracies, but generally folk are pretty good at only putting in things they're sure about (to be honest it's no less inaccurate than TOPS!) and this helps the level of info available.
Info on passenger workings (EMUs/DMUs/Chiltern/Scotrail 68s/Virgin Thunderbirds etc.) tend to be entirely on Genius and other systems that only those in the industry have access to, so unless someone's seen the train in question and can confirm with Mk1 eyeball, for things like this you're often relying on good folk from in the industry who have access to the 'magic box' and can check these for us. Likewise, folk in the industry are also likely to have access to "live" TOPS so can see where things are at any given time, plus full consists of trains (wagon numbers/actual trailing loads/changes en route etc.) which aren't usually available on the periodic downloads on "free to public" sites.
Happy for folk to add to/correct to the above as it's just my (broad) understanding of how things work, but hopefully helps a bit in terms of understand how to find info/where it comes from.