IR detectors do not use heat. They use a focused beam of light which is just below what our eyes can detect, just below the color red, hence the term infra-red. There are two types. One contains both the emitter LED and the detector photo-diode and bounces the beam off the train. The other has the emitter on one side of the track and the detector on the other side and the train interrupts the beam signalling the dection circuit. Be glad to add more if needed on this subject.
You are confusing passive infrared with an infrared transmitter/ receiver. The detector being discussed here is a passive device which others have explained senses changes in the area being monitored.
The principle it's based on is that everything above 0 degrees Kelvin emits some level of IR. even a tire rolling across the workshop emits IR. If you take the cover off a PIR you will see a multi-faceted reflector which has different passive zones, and any change in IR energy from one zone to the next creates a change of state. Sensitivity control, either preset or adjustable, will usually eliminate false alarms.