How about an RFID chip (costs nothing) on every sleeper. Little database and you know exactly where you are. Accurate a few centimeters
https://www.universalsignalling.com/news/latest#h.12nuchpah7...
The spit up of grease, leaves, metal particulate from rail and wheel grind, etc gets pretty thick.
The vision challenge is to cheaply and effectively keep a clean lens.
There's a similar challenge in monitoring production conveyor belts in mineral processing - vibration, tempreture, rocks kick about, dust make for a savage environment.