The Waterburys are an affluent family who live in a luxurious Edwardian villa in the suburbs of London. Charles Waterbury, the patriarch, works at the Foreign and Commonwealth Office. He is arrested on suspicion of being a spy. This is hidden from the rest of the family by his wife. The family become impoverished and are forced to move to a house called ‘Three Chimneys’ in Yorkshire, which is near Oakworth railway station. When they arrive, they find the house in a mess and rat-infested. The three children, Roberta (known by her nickname Bobbie), Phyllis, and Peter find amusement in watching the trains on the nearby railway line and waving to the passengers. They become friends with Albert Perks, the station porter, and with an elderly gentleman who regularly takes the 9:15 train. To make ends meet, their mother works as a writer and also home schools the children.
Mrs Waterbury falls ill with the flu. Bobbie writes to the gentleman, who delivers food and medicine to the house to help their mother get better. They are admonished by their mother for telling others of their plight and asking for assistance. The following day, a man is found at the railway station. He speaks a language that no-one can understand. The children figure out that he can speak French, which their mother is fluent in. Mrs Waterbury discovers that the man is an exiled Russian writer who has arrived in England to find his family who had fled there. He stays with them at their house. Bobbie writes another letter to the gentleman asking him to help in finding the exile’s family, who are soon found.
One day, while watching the railway tracks, they notice that there has been a landslide which has partially obstructed the tracks. The children fashion their red petticoats into flags which they use to warn the driver of the impending danger. The train stops due to their warning. The railway company and villagers hold a party for the children and thank them for their actions. The children are given personalised engraved watches and are dubbed “The Railway Children”.
The children find out that Mr Perks, the station porter, doesn’t celebrate his birthday. They secretly ask for gifts from the villagers that he has helped in the past and deliver the gifts to his house. Mr Perks initially refuses the gifts as he doesn’t accept charity. However, after the children explain that the gifts are from people that he has helped over the years, he thanks them for their kindness. In return the following day, he delivers old newspapers and magazines for them to read. Bobbie reads one of the newspapers and notices a story about their father being imprisoned. She discusses this with her mother who finally discloses that their father is in prison after having been falsely convicted of being a spy and selling state secrets. She speculates that a jealous colleague of his may be behind it. Bobbie again contacts the gentleman and asks him to help her father.
A group of youths are playing a game of paper chase which the children observe. One of the boys injures his leg in a railway tunnel and is helped by the children. He is taken to their house where he recuperates from his injuries. The gentleman visits their house and reveals that the boy is his grandson, Jim, and thanks the family for looking after him. Jim and Bobbie grow close during his recuperation and promise to write to each other when he departs to his home. With a strange feeling of unease Bobbie excuses herself from her lessons and walks down to the railway, as the express passes with passengers frantically waving at her. With a growing sense of disorientation she stands on the station platform, where in the silent lingering smoke she sees her father, who has just alighted onto the platform after being exonerated and released from prison. She runs to greet her him. They return to ‘Three Chimneys’ and the family are reunited.