From his castle high on a hill, a mad scientist dispatches a giant robot to the village below. The villagers sound the alarm, afraid that the robot will ruin their crops, and a girl named Kate hopes that the angels of justice will save her village. Instead, Team Rocket—fresh from being blasted off by Pikachu—land right in front of the villagers, and Kate mistakes them for the superheroes known as Team Righteous. To convince the villagers of their villainy, Team Rocket knocks the robot out of commission. That just convinces everyone that they really are heroes!
The grateful villagers tell Team Rocket that the stranger in the castle keeps sending robots to destroy their fields during the harvest season, and they want Team "Righteous" to protect them. Surprisingly, Jessie thinks this is a great idea; they'll fool the village and turn it into Team Rocket territory. Meowth makes a Meowthmobile mecha out of the robot they destroyed, and Team Rocket heads for the castle. After a brief battle with another robot, they get inside and discover the robot's creator, Professor Brown.
Professor Brown is a shy inventor who actually built the robots to make friends with the villagers and help with the farm work. Team Rocket figures they can use this to their advantage, but now a swarm of Taillow is headed for the fields. This could destroy the harvest, so Professor Brown uses one of his devices to add rocket power to the Meowthmobile. Once the Meowthmobile flies up to the Taillow, Team Rocket is out of ideas, but Professor Brown uses his device to vacuum up the Taillow and save the harvest. Now he's the new hero of the village! Kate still wants James to stay, and James wants to stay too—except he accidentally launches Team Rocket and the Meowthmobile back into the sky. At least the people of the village will always remember them as heroes!
In a dark room, a man living a mansion dispatches a large cylindrical mecha with axes for hands toward a nearby village. At the village, a lookout sees the mecha and starts ringing a bell, summoning the villagers, who are armed with sharp farming instruments. They explain that the man in the mansion keeps sending mecha at the village, especially during harvesting season. As the mob charges to take down the mecha, a young woman, Kate, prays for help. Just then, Team Rocket falls from the sky, having recently been sent flying by an Electric attack from Ash's Pikachu. After crash-landing, they encounter the mob, whose members mistake them for the so-called Team Righteous, a trio of superheroes.
As the villagers cheer, Jessie suggests doing something evil to convince them that they are not Team Righteous. Before they could do so, however, they see the mecha rolling towards them. Believing it is the village's defense mechanism, they attack it with Arbok and Weezing. During the battle, the mecha stops, and a hatch in the front opens, releasing a watering can on a long arm that waters a nearby flower. At Meowth's prompting, the trio tackles the mecha on its back while it is distracted. However, they are surprised when this act simply earns the villagers' shared gratitude.
During the nighttime, Team Rocket learns about the origins of Team Righteous during a village meeting: this trio are the protagonists of a black-and-white TV show, portrayed by two actors who closely resemble Jessie and James, and a third, smaller actor who wears a Meowth suit; their uniforms are also very similar. As a result, Jessie believes the villagers have mistaken the show for news footage, because they are in a time warp. When the film ends, Kate steps forward, expresses her gratitude at the trio's arrival, and explains the village's annual dilemma. Jessie agrees to help out, and explains to James and Meowth that it could be an opportunity for them to set up a long-lasting Team Rocket stronghold that would please Giovanni.
The next day, Team Rocket redesigns the mecha they defeated earlier and uses it to roll towards the mansion, followed by the villagers. Their instruments suddenly detect another mecha from the mansion, so they stop, and the villagers hide behind trees near the path. The mansion's front doors open up, and an anthropomorphic mecha walks out and towers over Team Rocket's. The man in the mansion opens up a hatch on the mecha's chest and sends out a stream of tiny wheeled mechas, each holding a bouquet and chanting a welcoming message for the trio.
Jessie deduces it is a trick to make them let their guard down, and Team Rocket promptly destroys the smaller mechas before attacking the main mecha. Already heavily damaged, it runs for the mansion, and Team Rocket pursues it inside. There, they are confronted by the man in the mansion, who introduces himself as Professor Brown, a scientist specializing in mechas, which he builds for various purposes. James asks why he has been using the mechas to terrorize the village; Brown explains that he just wanted to make friends with the villagers, but since he was really shy, he instead sent a useful mecha as a present. It was meant to take over farming duties, but the villagers thought it was attacking. Jessie then realizes they could hire Brown to build a mecha army for them as part of Team Rocket's Hoenn base.
The trio informs the villagers about Brown's true intentions, and convinces them to accept his apology. Just then, a flock of Taillow arrives, and Team Rocket recognizes them as the same very strong ones they encountered the previous day. When the villagers express their fears that the swarm will destroy their crops, Team Rocket reluctantly decides to help them, though their assistance is short-lived, and the swarm heads for the village. At that moment, Brown applies a flight mechanism onto Team Rocket's mecha, allowing it to pursue the swarm. Though the mecha has no usable attacks left, Brown's device turns into a vacuum cleaner, which captures all of the Taillow. That evening, Brown tells the villagers about how, once he had fed all the Taillow, they flew away peacefully. The villagers thank him, and ask him to make more useful mechas for them.
Inside the mecha, Jessie expresses her intent to continue setting up a Hoenn stronghold for Team Rocket, while James decides to stay at the village, having fallen in love with Kate. However, James accidentally presses a button that activates the Planting Wing's rocket engines, and the mecha flies off. The villagers watch them leave, sadly concluding that Team Righteous had to move on to help someone else.
Unbeknownst to the villagers, the flying Meowth explodes, sending Team Rocket falling. They land in a forest and get caught hanging from a branch. James moans about the loss of his future with Kate, and Jessie advises him to give it up. Just then, Meowth realizes that they landed near Ash and his friends. The trio sees this as their chance to catch Pikachu again. Jessie's Wobbuffet comes out of its Poké Ball to agree, but it causes the branch to break, sending them all crashing to the ground.