The agency won the account after a strategic pitch against an undisclosed agency.
DLKW will develop a new identity for the service, evolving advertising from the animated TV work developed by Rainey Kelly Campbell Roalfe/Y&R, the last agency to work on the business.
The company was set up by Virgin in 1999. Its websites and call centres now account for nearly 18 per cent of national ticket revenues (excluding season tickets).
In June last year, the company was acquired for £163 million by the private equity company Exponent Private Equity from a consortium of shareholders, including Virgin, Stagecoach and National Express transport groups.
As well as its own site, thetrainline.com, it also operates sites for 16 of Britain's 21 rail operators, and offers a business travel service for clients.
Greg Delaney, the chairman of DLKW, said: "We're very excited to be working with The Trainline. It's a great brand with huge potential."