Q:

What is a good approach to detecting distance and speed in model railroads?

Up front I must admit to little hands-on knowledge of modern microcontrollers and their software - I know power engineering and big motors much better (45 years of it).
Now, my question:
Trying to get grandchildren enthused about electronics. They love model railroads, so we are building a train monitoring system bit by bit.
Current problem: To detect distance (optionally speed) of a locomotive from a specific track location, without messing with track power.
Control platform: Stellaris Launchpad
Options considered:
* TSOPxxxx with "dumb" fixed frequency oscillator and RF LED on loco - How do I get speed info?
* TSOPxxxx and emitter at trackside, reflection from loco - can get speed by time-of-flight, maybe
* 5 Volt red lasers and break detection by red LED as sensor (the kids love the lasers, so...) - no speed detection without multiple devices per detection location
* RFID tags and a coil at trackside (will identify the specific loco which is a plus) - no speed info
* Ultrasonic distance sensors - Ubiquitous and well supported by netizens, but too broad a coverage angle I suspect
* One of many readymade model railroad products - counter to the purpose of this exercise  
So, which of these approaches, or any others, will give me the least grief at the software end, and yet will involve sufficient opportunity to engage 8 to 12 year olds in hands on electronic design with results they can experience? What are the pitfalls to watch out for (besides spilled cola)?
The trains are N-scale (1:160 scale).

A:

If I were automating a model railroad I would put barcode labels on the bottoms of the train cars.  Then spread throughout the track I would place barcode readers, facing up from between the rails.
With this you can detect the position, speed, and identity of the cars.  Each car would have its own unique barcode, not just the locomotive.
The position sensing of this method is very course, since it relies on when a train passes over a sensor.  But it should work fine for most things.  You can always put more sensors at important points in the track and less sensors where it doesn't matter so much.
A huge advantage of this method is that the price per train car is very low, only a label that you can print up on your laser or ink-jet printer.  The complexity per train car is very low.  And the weight added to each car is super low as well.
I would implement this by using an IR LED and Phototransistor as the sensor (there are components with both of these built in), and connect these to a microcontroller.  Each sensor has its own microcontroller.  The different sensors can then be connected together using a simple network (like an RS-485 bus).  With IR LEDs, the sensor would be difficult to see with the naked eye.  Total cost per sensor+MCU could be under US$3, not including a small PCB.

A:

I would start with the optical interruptor or reflector method on either side of Road crossings to signal approaching trains and turn on a flashing RED LED. Remote tracking can also be wire to a trainmap with indicators of trains crossing and direct and speed.
Bar-code scanner is deceptively simple until you have to deal with laser beam safety, label speed tracking rates and computing bar gap interval time to compute speed and validating contents of code to determine direct
ion in software.
Breakdown the project into;

system functional design

inputs , processes, ouputs ( include false trigger rejection)

electronics design

schematic, BOM, layout

optical path design

emitter & detector paths and range, frequency response, noise rejection

construction & testing

wiring with power off the track, noise filtering and mechanical, electrical details

IR can detect interruption of signal on either side easiest or reflection of signal from the same side with a wider range of detection. THe sequence to two adjacent detectors tells which direction and the time interval indicates the speed. This can be measured with either analog or digital methods.
IR barcode scanners either rely on the code going past the detector at aconstant speed or the emitter being reflected past the barcode to be detected by scattering of light or absorption of black carbon. Steady laser beams facing up would need to be optically changed to lower the power to a safe level or spread and then focused for a short path length to reduce power density of stray light.

A:

Other answers have provided excellent inputs your requirement; My answer concentrates purely on proximity (and presence) sensing of model trains, no identification, in the scales which I take interest in, the tiny N and T scales. 
Keeping in mind your need for software simplicity, a chopped-infrared transmitter / sensor combination will be easiest. Your mention of the TSOP devices indicates you are already evaluating that path. Consider instead the TSSP4P38 which is designed specifically for proximity sensing using 38 KHz chopped IR:

Stating what may be obvious to you already: Distance sensing through time-of-flight of electromagnetic waves (IR, radar etc) is impractical for your purposes: Given the speed of light, resolution in femtoseconds or lower is needed for the 0 to 10 centimeter target distances you are probably working with (1:160 N-scale). In the "real world" transit paths you mention in a comment, distances may be larger, I speculate.
An IR reflective sensor mechanism used in model railroads typically involves, instead, intensity of the reflected IR signal, which would increase per inverse-square law with locomotive approach.
Your device would need to have an IR LED like the TSAL6200 and the TSSP4P38, housed in something like the diagram on Page 5 of the TSSP datasheet. The combination would be mounted between ties on your track, one facing each way. If you mount it low enough and pointing almost parallel to the tracks, external object reflections will be minimized, the tracks working as blinkers.
The output of the TSSP is a logic-level pulse of duration proportionate to the reflected IR. As a locomotive approaches, successive pulses get longer, so readings of at least 2 consecutive pulses, preferably several more, will provide a set of pulse durations and thereby a speed indication. From the datasheet:

The output pulse width of the TSSP4P38 has an almost  linear
  relationship to the distance of the emitter or the  distance of an
  reflecting object. The TSSP4P38 is optimized  to suppress almost all
  spurious pulses from energy saving  fluorescent lamps.

If you stay with practicable precision requirements for your device, "fast" versus "slow", "approaching" versus "receding", and of course presence of a locomotive within sensor range, are feasible.
You will have to baseline the system to account for static reflections e.g. from scenery. Also, calibration of actual speed versus consecutive pulse lengths will provide the "fast" / "slow" range mappings.
Pulse duration can be measured using a timer/counter input on your microcontroller of choice. There are several examples on the web for doing this on the Arduino, but as you have mentioned using a Stellaris Launchpad instead, some research may be needed for it.
This is a high-level overview of a solution, please feel free to ask if specific aspects need clarification. At a guess, given your stated background, this won't be an overnight project, but is achievable within a holiday season. Some of the readymade model railroad products you mentioned use this mechanism.

For a more general distance-sensing discussion, please look at this answer from an earlier question. 

