Railton was the son of George Scott Railton, the first Commissioner of The Salvation Army and Second in Command after its Founder General William Booth, and his wife, Marianne Deborah Lydia Ellen Parkyn. Although he saw little of him, David Railton shared his father's faith and concern for the poorest in society. He was educated at Keble College, Oxford, matriculating in 1904 and obtaining his BA degree in 1908 and was further educated at Bishop's Hostel, in Liverpool. Having joined the Church of England he was ordained in Liverpool in 1908 and took up the curacy of Edge Hill in Liverpool.
In 1910, he moved to Ashford, Kent, and in the following year became temporary chaplain to the Forces. He was curate of Folkestone in 1914–20, but had leave of absence to serve in France. He was awarded the Military Cross in 1916 for saving an officer and two men under heavy fire. Railton first had the idea of arranging for the body of an unknown serviceman to be transported back to England, and buried with full honours, in 1916, while he was serving on the Western Front during World War I. Later in the War he wrote to Lord Douglas Haig expressing this idea. He received no response, but felt reluctant to let it go.
After the War Railton became the vicar of St. John the Baptist Church at Margate, but he still hoped to impress the authorities with his idea. In August, 1920 he wrote to Bishop Ryle, the Dean of Westminster, about the possibility of giving an unidentified soldier a national burial service in Westminster Abbey. Ryle took up the idea and his and Lloyd George's enthusiasm won over the initially hesitant King George V. In October 1920 Railton heard that his idea had been accepted by the Government. A committee headed by Lord Curzon, the then Foreign Secretary, was arranging for an unknown "warrior" to be disinterred in France and brought to Westminster Abbey. On 7 November 1920 six, or according to other accounts four, working parties visited the battlefields of Ypres, the Marne, Cambrai, Arras, the Somme, and the Aisne, where units of the Royal Naval division as well as the Army had died: each party exhumed an unidentified body which was examined to ensure that it was British before being placed in a plain coffin. At midnight one of these coffins was chosen by Brigadier General L. J. Wyatt, General Officer Commanding troops in France and Flanders, and thus became the official "Unknown Warrior", placed in a new coffin bearing the inscription "A British Warrior who fell in the Great War 1914–1918 for King and Country". In 1916 Railton was an experienced and mature man in his thirties and was appalled at the sufferings and loss caused by the War. He later tried to explain why he had felt it was so important to commemorate the individual in this way. He recalled an incident near Armentières where he came across a grave with a rough wooden cross inscribed "An unknown British soldier, of the Black Watch":
How that grave caused me to think!... But, who was he, and who were they ?... Was he just a laddie.... There was no answer to those questions, nor has there ever been yet. So I thought and thought and wrestled in thought. What can I do to ease the pain of father, mother, brother, sister, sweetheart, wife and friend? Quietly and gradually there came out of the mist of thought this answer clear and strong, "Let this body – this symbol of him – be carried reverently over the sea to his native land". And I was happy for about five or ten minutes.