I think gliscor is a good counter, cause it specializes in physical attacks. Here's a moveset for gliscor to stop mega mawile:
EVs: 252 Attack/Defense, 4 Hp
Trait: Poison Heal
Protect, just to get some health back
Fire Fang, super effective against mawile and you can get a burn/flinch hax :)
E-Quake, nuff said here
Facade, double damage, very powerful
Hope this helps!