With the preview for next week's episode though, I'm worried about how Pikachu will manage given that he's struggled against Golisopod before. Hopefully, we don't get a deus ex machina out of nowhere like the Pikashunium-Z or something like that...
Actually, I could see Pikashunium Z not only happening here, but leading eventually into
why it happens.
It all goes back to Tapu Koko. Who first saw Ash battling Team Skull and took an interest in him? Tapu Koko. Who gave Ash a Z-Ring and Electrium Z, and even taught him how to activate it? Tapu Koko. Who swapped out Hala's Fightinium Z for an Electrium Z when Ash beat the Melemele Grand Trial? Tapu Koko. Who's been consistently testing Ash and Pikachu to see how far they've come with their Gigavolt Havoc? Tapu Koko. Who upgraded Ash's Z-Ring to a Z-Power Ring? All the tapu, but if memory serves, it was Tapu Koko's idea and the other tapu simply followed his lead. And what only started happening after the Z-Ring was upgraded by the tapu? Pikashunium Z.
I think some great calamity is about to befall Alola. Possibly greater than even the Necrozma crisis. Something that could interrupt either the finals, the exhibition battle against the Masked Royal, or the closing ceremony. And I think Tapu Koko either sees it coming or simply has a gut feeling that it's coming. What exactly it is, I can't say. Maybe Ultra Necrozma somehow goes crazy and must be stopped? Maybe another Guzzlord comes through an Ultra Wormhole, possibly this one being Shiny? Maybe Team Rocket redoubles their efforts? Hell, could be something completely different. The point being, I think Tapu Koko knows something's coming, maybe has even known this since the first S/M episode. I think he saw Ash taking on Team Skull and saw in him the potential to be the one to stop this threat. Or at least, to help him stop this threat.
I don't think Pikashunium Z or 10,000,000-Volt Thunderbolt is meant to be the final product, the culmination of all that Tapu Koko's been doing for Ash. I think it's simply a way he can gauge how far Ash and Pikachu have come. I think that Tapu Koko will see the Z-Crystal transform, see Pikachu pull off 10,000,000-Volt Thunderbolt either during this battle or at some point in the finals (because remember, Tapu Koko has yet to actually see that happen), and he will realize from that that Ash is ready.
The calamity, whatever it is, starts. Big panic, main characters doing what they can to save the others, whether as the Ultra Guardians or otherwise, whichever befits the situation more. Ash and the others are all battling the big bad, but nothing seems to be working. Then Tapu Koko appears before Ash, gives him a special Z-Crystal. The Tapunium Z. That- that will be the culmination of what Tapu Koko has been preparing Ash for. To be able to help one of the tapu pull off their signature Z-Move, one must surely be a truly unique and powerful individual. In the games, after all, you get the Tapunium Z after catching Tapu Koko, which happens after you become an island challenge champion and Alola's first Pokémon League champion. Once Tapu Koko sees 10,000,000-Volt Thunderbolt, that's when he knows Ash is really ready to be able to wield the Tapunium Z. And they established very early on that Tapu Koko does know Nature's Madness, too, so he's got what he needs on his end.
The battle resumes. Tapu Koko, for the third time, teaches Ash the poses to activate a Z-Crystal. Ash follows Tapu Koko's lead. Tapu Koko surrounds itself with its Z-Power and unleashes its full-force Z-Move; Guardian of Alola. Tapu Koko does what the others could not, and while it doesn't finish off whatever they're facing, it greatly weakens it to the point where battling it normally is actually feasible, and together, they finish it off, quite possibly involving Pikachu's Thunderbolt.
...But getting back to what you said, it doesn't even need to be Pikashunium Z. Pretty sure Ash'll have it a little easier this time if he actually goes for a super effective Z-Move instead of pulling out Corkscrew Crash against a Water-type.