They used to be down by something called the chair.It became possible to fasen the rails directly onto the tracks.The"pandrol" spring steel clip successfuly atached the rail to the ties.
Why does a train stay on the track?
The train stays on the track because its wleels
are flanged. They have a protecting rim that prevents them from moving
sideways . Early railroads used flange rails in tell they changed
to flange wleels.