I think it has been like that for some time. I tried to run a Third Rail Emu over an AC Electrified route and it would not let me I could run it in Free Roam though
When i first got into TSC (in 2017 or 18) it already did. My guess is that it’s done it since the introduction of QD.
No science on my end but I suppose it came with the introduction of trimodal routes (diesel always being an option, except U-Bahn I suppose). The first ones I know are NEC-NYNH and London-Faversham, although NEC-Philly might also have 3rd rail, visually at least. No idea what exactly makes trains know which section is which. But the intended experience is losing power when you fail to switch. There are all kinds of bimodal trains - the M8 and 395 being bi-electric, the ALP-45DP diesel-overhead and the FL-9 being diesel-3rd. Does 4th rail also distinguish itself? On North London Line. Did anyone try running tube stock there?