Ash and his friends arrives at the Castelia City Gym so he can battle Burgh, the Castelia City Gym Leader. When they get inside, they are amazed at how it is similar to a greenhouse. They find Burgh feeding a Sewaddle as he mentions how the trees were transferred from Pinwheel Forest to provide a natural environment for his Template:Type2s. Burgh opens up the battlefield, coming up from the under ground. The referee announces that the battle will be three-on-three.
Burgh summons Dwebble as his first, while Ash goes with Tepig. Iris and Cilan agree that Tepig is a solid choice. Just then, Iris realizes that Burgh's Dwebble looks different from Cilan's Dwebble. Tepig attacks first with Tackle, but Dwebble dodges it. Tepig tries again, but Dwebble uses Dig to avoid it and strike Tepig. When Dwebble follows up with a fast X-Scissor, Burgh reveals that Dwebble's rock shell is actually lighter than average, giving Dwebble more speed. Dwebble uses Protect to nullify Tepig's Ember before launching X-Scissor, which Tepig responds with Tackle. Ash decides to order a Flame Charge all-in, but another Protect stops it. With Tepig close, Dwebble uses Rock Wrecker to take out Tepig, part of Burgh's strategy.
For his second Pokémon, Ash sends out Sewaddle. Sewaddle fires Razor Leaf, but Protect once against stalls it. Dwebble charges with X-Scissor, but Sewaddle fires String Shot at the ceiling to dodge. Protect stops Sewaddle's Bug Bite counterattack before firing Rock Wrecker. Sewaddle once again uses String Shot to dodge and retaliate with Razor Leaf, but Protect once again stops it. When Dwebble fires another Rock Wrecker, Sewaddle uses String Shot to wrap and stop it. Sewaddle's Tackle hits before Dwebble can use X-Scissor, which separates Dwebble from its shell. Sewaddle keeps Dwebble from its shell with rapid Razor Leaf/Tackle pressure, knocking it out.
For his second, Burgh sends out Whirlipede. Iris and Cilan note that Tranquill and Tepig would be effective here, but Tepig is down and Tranquill isn't in Ash's party. Ash keeps Sewaddle in, having it dodge a Poison Sting attack with String Shot. Sewaddle fires String Shot on Whirlipede, but Whirlpede simply spins in place to break it. A Steamroller attack hits Sewaddle hard, and a follow-up attack couldn't be stopped by Sewaddle's Razor Leaf. Sewaddle tries to retaliate with Bug Bite, but Whirlipede's Iron Defense easily repulses it. Whirlipede lands another Steamroller before trying a knockout shot SolarBeam. Sewaddle surprisingly takes it and glows with light, evolving into Swadloon. Swadloon fires String Shot onto Whirlipede, but it once again shreds it. Swadloon tries to dodge a Steamroller with String Shot, but Whirlipede runs into the string, cutting it. Whirlipede prepares to attack again, but an Energy Ball attack stops that. One Tackle attack is enough to take Whirlipede out of the match.
Meanwhile, at the harbor, Team Rocket tries to get a hold of Giovanni, but they are unable to uncover their next assignment. Giovanni's secretary leaves them to decide their own mission, so they decide to once again pursue Ash's Pikachu, with new drive and a new motto, brining back their classic uniforms. A Yamask appears and checks out their computer. Jessie wants to catch it, sending out Woobat. James stops them and decides to feed it. It eats happily and afterwards, James asks it to join him, holding a Poké Ball. It goes in, allowing James to capture the Yamask.
Back at the gym, Burgh sends out his final Pokémon Leavanny, the guardian of the Gym. Swadloon fires Energy Ball, but Leavanny uses Protect to stop it before using String Shot to cover Swadloon. Ash has Swadloon fires Razor Leaf on itself, breaking the strings but inflicing residual damage on itself. Swadloon is unable to dodge a powerful Leaf Storm and a follow-up Hyper Beam, finally taking it out of the match. Ash recalls it and contemplates his final Pokémon. Oshawott comes out and volunteers, but Pikachu steps forward, which Ash picks, crushing Oshawott.
Pikachu fires Thunderbolt, but Leavanny simply ducks to avoid it. Leavanny uses Protect to stop Pikachu's Iron Tail before retaliating with Leaf Storm, but Thunderbolt cancels it. Leavanny uses String Shot to wrap and impair Pikachu. When Pikachu tries to dodge another Leaf Storm with Quick Attack, it is unable to move quickly and gets hit, since the strings have frozen Pikachu's tail and prevent it from balancing. Pikachu tries to break it by biting it, but the strings are resiliant. Pikachu gets knocked around by another Leaf Storm, and the strings impair Pikachu's Thunderbolt accuracy as well. A Hyper Beam attack once agains knocks Pikachu about the stadium. When Burgh orders another Leaf Storm, Ash decides to have Pikachu dive into it while spinning. The attack weakens the strings enough for Pikachu to shake off. Burgh tries to slow Pikachu again with more String Shot, but with Pikachu's balance in order, it easily uses Quick Attack to dodge and even a Thunderbolt to cancel one. Pikachu lands powerful hits with Iron Tail and Electro Ball, taking down Leavanny and winning the match for Ash. Burgh presents him the Insect Badge which Ash displays with pride before putting it into his badge case. With the victory, Ash and his friends leave the Gym.