It is quite a task to book a train ticket from outside of India. The pain in the neck is to register yourself with Indian railways OTA arm,IRCTC. Follow steps below to register yourself at IRCTC:
- Signup at IRCTC website. For the text box, Mobile,provide any number including your non Indian number though the text box is prefixed with +91
- With the chosen username as subject, send a scanned copy of your passport to care(at)irctc.co.in. Scanned passport should be sent as an attachment only (not embedded inside the email body) and size of this attachment should be less than 1MB.
- IRCTC, within one working day, will send you an email with mobile verification code to your registered email ID.
Phew! you are now registered at IRCTC. Now head to http://cleartrip.com to make the actual ticket booking. IRCTC accepts only India issued credit cards but cleartrip, an authorized agent of IRCTC, accepts International credit cards as well. However, to buy train ticket at cleartrip, you need to be registered at IRCTC (do not ask why). Thankfully, registration at cleartrip is a breeze.
You second option:
Book from International Tourist Bureau once you are in India

Make a detailed itinerary by using cleartrip which has a user friendly interface to understand train schedules. Once in India, head to International Tourist Bureau (First Floor, New Delhi Railway Station), buy Indrail pass and them make reservations based on your itinerary. You could get confirmed reservations as most trains in India have special foreigners quota.
NOTE: You cannot avail foreigners quota online while booking thru IRCTC or cleartrip
Practical Option:
Book thru an agent
http://www.indianrail.gov.in/international_Tourist.html lists Travel agents outside India. Approach them for booking your train tickets. If you are travelling from UK, contact M/s S.D. Enterprises Ltd,(001819033411)are well connected with Indian Railways