Ash and Goh arrive at Wyndon by train, planning to switch to a train that'll take them to Stow-on-Side. While walking backwards for a moment to talk to Goh, Ash ends up accidentally bumping into Allister, who flees out of timidness when Ash tries to apologize. Ash notices that Allister dropped his ticket, but Allister doesn't respond to his calls, so he and Goh run after him and down a set of stairs to a dark train platform shrouded in a strange mist. The PA system declares that the train that they see Allister boarding is headed for Stow-on-Side, so they board it as well, the doors closing behind them as the train, referred to by the PA system as the Ghost Train, departs.
Ash takes a look at Allister's ticket and finds out that he's in coach 1. As such, he and Goh start traversing through the train to return the ticket to him. The first coach they enter is a luxury coach, where they find an Odd Keystone. When Ash leans closer to examine it, Grookey jumps onto him and causes him to hit the keystone off its pedestal and onto the floor. Ash and Goh try to lift it back up, but find it too heavy to lift. Goh notices a strange light emerging from the keystone and entering Ash's body, but Ash doesn't notice it. However, as they move on, the lights start turning on and off, and Ash's face starts taking on an unusual expression. When Goh spots some shadows in the window of the door leading to the next coach, Ash starts mocking him for being scared and pushes him through the door. When the lights turn back on, Ash apologizes to Goh and realizes something's wrong with him.
The shadows Goh saw turn out to be a swarm of Drifloon. He uses his Rotom Phone on them, finding out that they sometimes drag children into the afterlife. The lights turn off again, and Ash starts grabbing some Drifloon and tries to make them hold onto Goh, much to the latter's horror as he tries to run away. However, the Drifloon can't hold onto Goh and float away, with Goh's Rotom Phone resuming that sometimes children pull on Drifloon instead of vice versa. Ash still finds Goh having been scared hilarious and laughs, although internally, he hates how he's acting mean towards Goh for some reason.
The next coach is overgrown with trees and filled with Pumpkaboo. Ash accuses Goh of being scared, and suggests a game of rock-paper-scissors to decide who'll have to enter first. Goh accepts, but Ash cheats to win and forces Goh to go in first. He keeps scaring Goh by claiming to spot things like a will-o'-the-wisp or zombies, which actually turn out to be just a Sableye and a group of Nincada, respectively. The Nincada then suddenly evolve into a swarm of Ninjask, which start flying into Goh while Ash holds him in places. Angered by this, Pikachu uses Thunderbolt, shocking everyone and sending the Ninjask flying out of the train. While Goh recovers, his Rotom Phone suddenly informs him that he's obtained a Shedinja, which can mysteriously appear in a Poké Ball when a Nincada evolves. Unexpectedly, Allister then enters the coach, surprised to see other humans aboard the Ghost Train.
A sudden loud noise coming from the luxury coach catches everyone's attention. When Goh and Allister look out the window, the luxury coach's roof is blown off and a Spiritomb emerges from it. Allister translates its speech, revealing that the Forbidden Pokémon is demanding for its spirit to be returned. Goh is surprised to see Allister being able to understand Spiritomb, but his attention is quickly redirected to Ash, whose face has now changed to completely match that of Spiritomb. Allister reveals that an ill-natured spirit from Spiritomb is residing within Ash, explaining his odd behavior. Pikachu tries to shock Ash to drive the spirit away, but it doesn't work. However, as the train rocks, a branch from a tree falls on Ash's head, knocking him out.
Fearing the Spiritomb's rampage might derail the train, Goh says he'll stop Spiritomb and begs for Allister to return Ash to normal. After some hesitation, Allister agrees to try. Goh thanks him, calls out his Absol, and rushes off. Allister calls a Sinistea to help, asking it to pour some of its tea into Ash's mouth. Allister explains to Pikachu that Sinistea has the ability to absorb life force, which could help to flush out the ill-natured spirit inside Ash, although the heinous taste of Sinistea's tea causes Ash to jump up in disgust. A moment later, the spirit is indeed forced out of Ash, but it then hides in his shadow. Not wasting a moment, Ash calls out his Gengar, who dives into his shadow and retrieves the spirit. Ash rushes to help Goh, with Gengar narrowly saving Absol from being blown off the train by Spiritomb's Shadow Ball. Ash utilizes Gengar's shadow-jumping powers to confuse Spiritomb while Absol kicks up a piece of debris, allowing Gengar to jump out of its shadow and push the spirit back into Spiritomb, calming the Forbidden Pokémon down and making it return into its Odd Keystone.
Later, the Ghost Train makes a stop at a graveyard, where a group of Gastly and Haunter takes the keystone with them. Allister explains that Spiritomb wanted to come here, since the Ghost Train is a train for Ghost-type Pokémon, with him being its only regular human passenger. The train continues on to Stow-on-Side, where Ash, Goh, and Allister disembark it. When Ash turns around to return Allister's ticket, both Allister and the Ghost Train have vanished, leaving the boys unsure if anything they just experienced actually happened.