Born on January 4, 1835, in Coulston, Surrey, Lyall received his education at Eton and Haileybury College. He joined the Indian civil service at Bulandshahr in the Doab in 1856 and served in many capacities until his retirement in 1887.