Sounds like a potential application for a well-constructed IR light barrier system.
In this case it would act as an IR curtain.
Outdoors will need shielding from the Sun and more intricate design/installation.
Have you eliminated PIR sensors (shielded to work only in the targeted area)? If so why?
Cool idea about the train tracks, .....Looks like the patent is blown now, unless you have already filed.
A more elaborate approach would be laser based. ...... a lá the movie Mission Impossible
Other than PIR, installation would be not be trivial.
Another approach would be to use technology like "Foot-fall" counting like in Shopping malls. Could be done with a Raspberry Pi (Or similar) & cameras.