This is what I've been thinking. At some point after Roggenrola evolves, Ash and Trip battle, Boldore vs. Gurdurr. It ends in a tie, and Trip reveals that both Gurdurr and Boldore evolve through trading, and asks Ash if he wants to temporarily trade Pokemon to evolve them. Ash isn't sure at first, but when both Gurdurr and Boldore express interest in the idea, he agrees to it. After the trade takes place, Ash sends out Gurdurr and Trip sends out Boldore, and the two Pokémon evolve. Then, Team Rocket enters the Pokémon Center in which the trade is being made, and uses a machine to suck up everybody's Poké Balls (and a special attachment for swiping Pikachu and Axew), but since Conkeldurr and Gigalith are already out of their Poké Balls, they don't get stolen. Ash and Trip team up to stop Team Rocket, Ash commanding Conkeldurr, and Trip commanding Gigalith. Once Team Rocket is defeated, and everyone gets their Pokemon back, Cilan tells them that Ash and Conkeldurr made a great team and worked together flawlessly, and says the same thing about Trip and Gigalith. The two rivals think about this and wind up agreeing to make the trade permanent.