Sir Topham Hatt and his family have left the Island of Sodor on holiday, leaving Mr. Conductor, the owner of Shining Time Station, in charge of the engines. Gordon complains to Thomas, when Diesel 10 races by, scaring both engines. Meanwhile, in Shining Time, Mr. Conductor is suffering a crisis; his supply of magic gold dust is alarmingly low and not enough for him to travel back from Sodor. At Tidmouth Sheds, Thomas is talking to James, when Diesel 10 arrives and announces his plan to rid Sodor of steam engines by finding and destroying Lady, the lost engine, the key to steam engines living in peace. Thomas leaves to collect Mr. Conductor. Lady is hidden in a workshop on Muffle Mountain after Diesel 10’s previous attempt to destroy her. Lady is unable to steam despite trying all of the coals in Indian Valley. That night, Diesel 10 approaches the shed where the steam engines are sleeping and destroys the side of it with his claw. Mr. Conductor tries to keep him in order, but the gold dust fails and Mr. Conductor scares Diesel 10 away by threatening to pour a bag of sugar in his fuel tanks.
Burnett’s granddaughter, Lily Stone, is visiting her grandfather. She meets a dog called Mutt at the railway station. At the sheds, the steam engines express their concerns about diesels to Mr. Conductor, unaware that Diesel 10’s oafish diesel minions Splatter and Dodge are spying on them. Lily meets Mr. Conductor’s cousin Junior and Stacy Jones before she is taken to Burnett’s house. Mr. Conductor calls Junior to help him with his gold dust crisis. While talking at Knapford that night, Percy and Thomas conclude there is a secret railway between Sodor and Shining Time. After spying on their conversation and hearing everything, Diesel 10 goes to the Ironworks to tell Splatter and Dodge of his plans to destroy Lady and the other steam engines. Observing this, Toby distracts Diesel 10 by ringing his bell, causing Diesel 10 to knock one of the supports out from the shed with his claw, which collapses the roof on top of them. The next morning, Thomas collects six coal trucks for Henry, and one of them accidentally rolls through the buffers that lead to the secret railway. Later that day, Mr. Conductor is ambushed by Diesel 10, who scoops him up with his claw and threatens to drop Mr. Conductor off a viaduct unless he divulges the location of the buffers. Before Diesel 10 can drop him, Mr. Conductor cuts one of the claw’s fuel hoses with a pair of tin snips, and is thrown free. He lands at the Sodor windmill, where he finds a clue to the source of the gold dust.
Lily meets Patch, who takes her to Shining Time, where she meets Junior again. Junior takes her through the Magic Railroad to Sodor, where they meet Thomas. Thomas is not happy to see Junior, but agrees to help him and Lily and takes them to the Windmill, where they find Mr. Conductor. Junior climbs onto one of the sails and is thrown onto Diesel 10’s roof. Later that night, Percy finds that Splatter and Dodge have found the Sodor entrance to the Magic Railroad and goes to warn Thomas. Thomas agrees to take Lily home. While traveling through the Magic Railroad, Thomas discovers the missing coal truck, which he collects. Lily goes to find Burnett, leaving Thomas stranded. Thomas rolls down the mountain and re-enters the Magic Railroad through another secret portal.
Lily finds Burnett in his workshop and he explains the problem getting Lady to steam. Lily suggests using a special coal from Sodor. Patch retrieves the truck and Burnett uses the coal to fire Lady. Now steaming, Lady takes Burnett, Lily, Patch and Mutt along the Magic Railroad. Thomas arrives and the two engines return to Sodor, where they meet Mr. Conductor and Junior. Diesel 10 arrives with Splatter and Dodge, who decide to stop helping him. Diesel 10 chases Lady, but Thomas races between them, heading towards the viaduct. Thomas and Lady both make it safely across, but the viaduct collapses under Diesel 10’s weight, and he falls and lands onto a barge filled with sludge.
Thomas, Lady and Burnett return to the grotto; Lily combines water from a wishing well and shavings from the Magic Railroad to make more gold dust. Junior decides to go to work on Sodor and Mr. Conductor gives him his conductor’s hat before sending him to another railway. Lily, Burnett, Patch and Mutt return to Shining Time, and Lady returns to the Magic Railroad while Thomas travels home into the sunset.