Their father goes away with two strangers. Their mother, a writer, moves with them to the boring countryside. However, they soon come to love the railway that runs near their cottage, and they make a habit of waving to the Old Gentleman who rides on it. They befriend the porter, Perks, and through him learn railway lore and much else.
They have many adventures, and when they save a train from disaster, they are helped by the Old Gentleman to solve the mystery of their father's disappearance, and the family is happily reunited.