The 'rocks' on rail tracks (well, between and around them) are called ballast. It serves several functions.
1) It prevents the rails from moving sideways which would be the natural tendency around most curves - the train would normally push the lines outward and the ballast stops this happening for the most part.
2) It provides a cushion and a bed for the track to lie on - the cushioning effect gives a smoother train ride and prevents hard jolting, and the bed means the rails won't sink into the ground in some places which would give a rollercoaster-like ride and be very uncomfortable as well as dangerous.
3) It aids drainage of the rail lines - the water will not be able to sit around the sleepers or ties which could rust or rot them, and similarly the steel rails, but it drains through the ballast and away.
4) It is an easy way to make a level running surface for trains - special track tamping machines are used to re-pack these ballast rocks around and underneath rails where they have been pushed out by the constant passing and vibration of trains. Much easier than trying to make a completely level track bed on the earth, and cheaper than using concrete beds all the way too.
sources: "n_gined" from Yahoo answers
Ballast
About 21 inches
There are a lot of railroad tracks in South America.
There are 7,021 miles of railroad tracks currently in Egypt
Trestles
train tracks or a railroad
There was almost 3,00 miles of railroad tracks in 1840.
Railroad tracks present no problems for a motorcyclist true or false
no
Under a rock, under rotten wood i.e. railroad ties.
Railroad tracks are made from steel.
made and monitored slopes in railroad tracks.