Self-Explanatory.
If used by a Pokémon other than Ogerpon, Ivy Cudgel will always be a Grass-type move, even if that Pokémon holds one of the masks.
Bulbapedia's Ivy Cudgel page
I think this answers your question. Hope it helped.