So if the "requirement" is to only distinguish between 3 targets here's my latest scheme which doesn't require the use of a serial Arduino port (again, I'm thinking you might not have sufficient serial comm resources if the Arduino is already communicating serially with the TIU to send engine commands). To be clear, I acknowledge the NFC method can identify/distinguish between gazillions of different targets.
Sooo. Let's say you can position 3 magnetic sensors left-to-right or perpendicular to the direction of travel on the track bed between the center-rail and the outer-rail. In the photo above I show 3 reed switches but these could be 3 Hall sensor chips which are equally small or smaller. On the bottom of each engine, you mount 1, 2, or 3 tiny Neodymium magnet discs left-to-right centered over the 3 track-bed sensors. So when an engine passes, either 1, 2, or 3 of the sensors will be triggered and this would identify 1 of 7 possible engines - with 3 "bits" there are 8 possibilities but the 000 case is when there is no engine passing which is the idle state.
So the 3 sensors would simply drive 3 Arduino digital inputs - no serial port required. The software is arguably simpler. You simply look to see if 1, 2, or 3 of the inputs are active which tells you an engine is passing over the sensors and of course implicitly tells you the 3-bit address/identity of the passing engine. Tiny Nd disc magnets are maybe 10 cents. Reed switches or Hall sensors are maybe 50 cents.
Since the "data" is parallel (vs. serial), the aperture issue is solved by simply using 3 capacitors to peak-detect a triggered sensor to "hold" the data for, say, 1 second to give the Arduino plenty of time to sample the 3 input wires for activity. That's another 50 cents in parts.
I had considered the same concept except aiming 3 IR LED-detector from track-bed up to the bottom of the engine(s) looking for reflections. So you'd just print 3 white/black stripe pattern left-to-right on the bottom. Problem of course is you'd get reflections off of shiny wheel axles and who knows what else so I scrapped the parallel passive optical method.
Clearly this is a one-off alternative with perhaps no other application but at least is inexpensive. It looks like that Adafruit NFC reader module is $40? And passive tags are maybe a few bucks each.