Hmm, I think electrifying it would be one of those "for the sake of it" things. You'd soon tire of holding the button and waiting for it to finish moving.
But, here's a few ideas ...
A DC motor will reverse depending on which way you apply the power - two push buttons, both changeover, is all you need. Each pushbutton connects one side of the motor to the power supply, and both connect to same side of the supply (say -ve) when off. Pressing the button therefore switches it's side of the motor to the other side (say +ve) of the supply and the motor runs while the button is pressed. Pressing both buttons together will just stop the motor as both sides of it will now be connected to the same side (+ve) of the supply.
If you want limit switches, then put them between the pushbutton switch and the supply (+ve) so it cuts the power from the "on" position of the switch when tripped.
Instead of pushbuttons, you can use an electric window switch from an older car. These are a 5 terminal switch, but are specially made for the application.
You can do the same with a lot of small AC motors. A lot of motors used for things like curtains/blinds, air conditioning dampers, and so on, simply have two identical windings and a capacitor. The windings are connected together at one end and to one side of the supply. At the other side, the capacitor is connected between them, and the two ends are brought out to terminals. Connecting the other side of the AC to one of the terminals will make the motor run, the direction being determined by which terminal you use. Your pushbuttons simply connect the power to one side or other of the motor - or it can be a rocker switch with centre off. If you use pushbuttons, one of them must be a changeover and cut the power from the other switch when pressed - otherwise pressing both of them will connect power to both windings of the motor and it may run in either direction, but if not already running then it will hum and take lots of current until something trips.
Mechanically, looking at the rails, put a pulley at the outer end of the fixed section, and run a loop of flexible wire or cord in a loop and round a pulley driven by a motor at the rear end. the wire/cord is attached to the moving section, goes round the pulley, back to the motor, round that pulley, and out to the moving section again. The motor can pull the carriage backwards (directly) or forwards (via the front pulley).
I mentioned car electric window switches. Most newer models have a (very annoying) feature where you press the button for more than a nanosecond and they go into auto mode and fully open or fully shut the window. So grab the switches and window ECU (often in the drivers door) from such a car and you can have a system that will fully extend or retract the rail automatically.