The best counter for mawile is basically aegilash, until I work my way around it. Either way if you can stall out trick room, things such as talonflame and heatran should work. Bear in mind if they're willing to sacrifice mawile, or you don't run a near max defense set, it will still deal very heavy damage if not KO. Same for volcarona, but flame body can put it out of action. Sableye will always more or less force a switch. Equally, sword dance sets will require massive prediction to beat usually. Trying not to die whilst under trick room, having hazards out, outspeeding and KOing with stuff like talonflame, and after that trying to stop tr being set again. Big threat, aegilash is a deadly check. To an extent it depends on the set.
Aegislash gets murdered by Mawile.
If Aegislash attacks unboosted he's barely gonna scratch her.
252+ Atk (custom) Shadow Sneak vs. 252 HP / 0 Def Mawile: 41-49 (13.48 - 16.11%) -- 9HKO at best
252+ Atk (custom) Iron Head vs. 252 HP / 0 Def Mawile: 121-144 (39.8 - 47.36%) -- guaranteed 3HKO
252+ Atk (custom) Shadow Claw vs. 252 HP / 0 Def Mawile: 121-144 (39.8 - 47.36%) -- guaranteed 3HKO
252+ Atk (custom) Sacred Sword vs. 252 HP / 0 Def Mawile: 91-108 (29.93 - 35.52%) -- guaranteed 4HKO
And then let's see SpA based Modest Aegislash (or Quiet whatev)
252+ SpA (custom) Shadow Ball vs. 252 HP / 0 SpD Mawile: 154-183 (50.65 - 60.19%) -- 85.94% chance to 2HKO
252+ SpA (custom) (Move 1) vs. 252 HP / 0 SpD Mawile: 312-368 (102.63 - 121.05%) -- guaranteed OHKO (that's HP fire on no SpD investment Mawile, it BARELY ohkos)
Meanwhile, Mawile can counter with crazy damage even on shield form :
252+ Atk Huge Power Mawile Sucker Punch vs. 252 HP / 0 Def Shield Form Aegislash : 232-274 (71.6 - 84.56%) -- guaranteed 2HKO.
If Aegislash opens with King's Shield, Mawile can just grab a sub / Sword Dance then laugh.
+2 252+ Atk Huge Power Mawile Sucker Punch vs. 252 HP / 252+ Def (custom): 356-420 (109.87 - 129.62%) -- guaranteed OHKO (Impish 252/252 aegislash)