Let's start with something that didn't work too well. I set up a photocell and photoresistor--and they reliably detected the train--but I had 3 to 4 inches of variance in where the train actually stopped after detection.
Using a reed relay (Jameco #111448) and a bar magnet glued to a train car, I was able to get my "variable stopping distance" down to about one inch.
Connect wire wrap wire across the relay contacts--the relay will close when the magnet is near.
The stop arm is mounted to the servo horn (HiTec HS-311 servo, amazon.com) using #4-40 machine screws.
Using 4 x 3/4 wood screws, I mount the servo/arm assembly and support brace (opposite side of track) to the plywood base.