What sensor do I need to measure distance from the side along a straight line?
Ultrasound sensor becomes erratic at distances greater than few feet, since the echo comes back from several angles and objects.  Use a visual aid, or by employing a cheap video camera at an angle close to the rail and calculating the person's distance by the displacement of the person on the image, or, by observing the LED light reflection on the person, you would need to flash the LEDs very fast and observe when the person gets illuminated. 

An infrared emitter and sensor could be included per each one or two step(s) of the stairs, also in the rail, and observing which feedback is stronger, thus turning on the corresponding LED. 

There are capacitive sensors, but the actual technology works fine for touching distance. 

Pressure sensors could also be used (bare flat switch contact) under the carpet of the stair steps, once the person steps on it, closes electrical contact.  

Or, maybe the original idea of ultrasound sensors on the under the rail, sensing if the person is closer, but you could not use a bunch of sensors, except if the sensors are triggered individually with time.  

Unrelated note: Dogs hate ultrasonic sensors.