 It is the 1890s. Bob Gregson is a young lad who works as a porter at a rural railway station. He is keen to impress the stationmaster who is looking for a successor because he is about to retire. Having fallen in love with a teacher called Harriet Collins, Bob wants to raise money to save the local orphanage where she works and where he was brought up, after he hears that a local businessman, Mr Riorden, wants to sell it as part of a property deal. He discovers a stray Jack Russell terrier in one of the crates of goods that were delivered to the station and finds out that it can perform tricks such as standing on its hind legs because it had previously worked in a circus. "Station Jim" soon becomes a local attraction with the passengers who pay money to see its tricks. Then it is announced that Queen Victoria will be visiting the station. If Bob plays his cards right, maybe he could persuade her to become a patron of the orphanage. Surely Mr Riorden would have second thoughts if she was a patron. Unknown to him, some anti-royalist terrorists are planning to shoot Victoria during the visit, but Station Jim recognises that the assassin is his old owner at the circus, foils the attempt and saves the day.