Of the newer Totem Pokemon you will find during your second journey through The Alola Region, Togedemaru will most likely be the toughest of the bunch. On top of it being a speedy Pokemon that packs a bit on an offensive punch, Totem Togedemaru will have its Defense Stat raised by one level as the battle begins. Essentially, this gives Togedemaru enough bulk to counter its weakness towards Ground Type Attacks. On top of all of this, Totem Togedemaru knows the move Spikey Shield, the same it can use to counter an incoming Z Move.
Because of all of this, there isn't an easy way to defeat Togedemaru. Your best bet is to capture one of the stronger Fire Type Pokemon back in Wela Volcano Park on Akala Island, training it as you continue your journey until this very trial. Before facing Totem Togedemaru, attach said Fire Type with the Fire Z Crystal you received from Captain Kiawe. If you get lucky and Togedemaru uses Spikey Shield on the first turn of the Totem Battle against said Fire Type, hold off on using your Z Move until the following turn. When the second turn happens, unleash your Fire Type Z Move against Togedemaru, hopefully with a Special Type Attack so it can hit Togedemaru where it is weakest. If luck is on your side, you will defeat it in one blow so you can focus on the Pokemon it called upon for help.