Mamoswine shines in raids/PvE not PvP. It's the best ice attacker in the game.
Lugia has the highest TDO in the game right now. It should survive Mamoswine even if it's weak to both it's fast and charge moves
Rayquaza for example is trash in PvP but that does not in any way means that it's not a strong pokemon.
Edit: After performing some quick tests, in a no shields 1v1 battle between a Lugia and Mamo, both perfect IV and same level, the matchups Mamoswine loses against is Lugia with HydroPump or Future Sight.
In conclusion, OP, a pokemon performing badly in 1 uneven battle, does not make it bad by stretch of the imagination. You are welcome, of course, to disagree.