A while ago, wearing another hat as a so-called "military expert" for Find My Past, I attempted to answer a query from Jean Field regarding her British Army ancestor who was apparently, at some point in time, serving concurrently with the Indian Railways. Jean's original query and my response is here, on the Find My Past blog.
Last week, re-reading Old Soldier Sahib by Frank Richards, I came across this passage which explains how the arrangement worked. Frank was a regular soldier serving in India at the turn of the last century with the 2nd Battalion, Royal Welsh Fusiliers and he later served with distinction throughout World War I, winning the DCM and the MM into the bargain. I wish I'd recalled this passage from Old Soldier Sahib when I originally replied to Jean.
"One railway company invited men of good character to go through a six months' course of railway training. The only men who were eligible for this course were those who had six or twelve months to serve before they became time-expired. If they went through this course they were away from the battalion for six months but drew their ration money and pay; the railway company found them lodgings and also paid them a rupee a day for the duration of the course. At the end of it they had to pass an examination, but even if they passed it they could still please themselves whether they took a job on the railway or went back to the battalion. If they accepted a job they were transferred to the Army Reserve, in spite of having perhaps six months still to serve before they became time-expired. They generally began work as passenger guards, and rose from that to something higher."