its not hard, and it looks vastly better, if you put the LED & Phototransistors under the track and use them to spot the guide blade passing - means a small cut in the rails.
there is a thread on the Scalextric Digital part of the forum about doing this - workings with digital but also perfectly serviceable with analogue - reporting the lane number in place of the car ID.
removes the need for the overhead gantry and using IR LEDs below the track seriously cuts out issues with stray lighting
I built the thing to function as a lap counter & timer to allow for multiple lanes, can provide the lap time, best lap time overall, best individual time, time to the car in front, time to the leader (obviously needs 3+ lanes for that to use useful) and swaps the display order to be the race order, along with managing some basic race features like a lights count down, race laps & time for normal or endurance racing.
the hardware is Arduino based and vanishingly simple (each lane for analogue would be an IR LED, Phototransistor and a pair of resistors - ideally a single IC providing schmitt triggers but these are not specifically required) - as written it doesn't use interrupts so can manage multiple lanes on a basic Arduino Uno or Nano (or pro mini if you want seriously small) - its currently assembled around a mega so as to have the lines for the display board but there are many options for doing that (or feed to a PC)