His tale, The Girl Who Had Never Been On a Train, was inspired by his observations of the passengers and staff, and by spending time on the trains and interacting with passengers,
David also unearthed people's summer memories, which inspired his story.
The story tells the tale of eleven year-old Chrissie who loves trains but she has yet to travel on an actual one.
When Chrissie finally gets on a train, with her Grandpa Henry, to go to London for an important operation, her trip from Scotland to London turns out to be quite literally magical – and is going to change Chrissie's life forever:.
Baddiel said: "I've always loved trains. They may be my favourite form of transport. I also think trains are inspirational for the imagination, especially on a long journey like London to Edinburgh.
"In a way, I"d like a private train to stay on every day, as I think I write better on them than at home.
"As is usual in my stories, something a bit weird and magical happens early on in the journey, and Chrissie gets taken somewhere she really didn't expect to go - although it all takes place on the train. Rather like the writing of it…"
'The Girl Who Had Never Been on a Train' is being unveiled as the first exclusive commission for BEAM, Virgin Trains" free on-board content platform.