There can be a variety of reasons behind it. First of all it is a government job. A railway job is recession proof, no pay cuts, no worry of getting fired, free travel, supports sportsman, study leaves, jobs for relative in case one dies, hospital and medical care, and many countless benefits are there, thus these benefits makes the Indian railways on of the best job.