Hi KC,
An idea I've had for inexpensive locomotive identification is to use Hall effect sensors to read the strength of a magnet; every loco on your layout would have a magnet of a unique magnetic field strength range. I started to play around with the idea but I only needed to identify 2 locos/motorized units, so I just did a magnet mounted left or right side under the chassis, with reed switches between the rails, since direction of travel would never change in my case.
I use insulated rail for occupancy detection without an issue.
Best wishes!!
Take care, Joe.