When I was a kid the first HO scale slot cars ran on AC vibrator motors - literally a chattering relay coil with a blade that would engage one tooth on the drive gear for the rear axle and push it a microscopic distance before retracting and then hitting the next tooth on the next cycle, and so on. Pretty noisy for such a small toy, but they did work.
When my sons were old enough to spot a car back on the track the cars and controllers were far advanced. I built them an epic layout in the basement, with almost 100 feet of track, and a digital lap counter I built using optical sensors under track and a lighted arch above them. Worked great, and the whole neighborhood was into it - for about a year, before they moved on to other things.
My wife found the steamer chest full of the track, controllers, power supply and cars last fall. My oldest son's boys are 9 and 11, and might get into it, but they are hard-core Lego Masters right now so no time for building race courses
Cheers!