I've found Mega Swampert to be pretty rare tbh and I never really struggle with it. Swampert is used on less than 49% of water teams and Swampertite is used on under 42% of Swamperts. So the chances of fighting a team with Mega Swampert is like under 2%. Also, if it doesn't run Rain Dance or use Politoed, then it is pretty slow. Grass Knot is 4x SE on it as well, and has 100BP against it.
Out of rain:
Only has 262 max speed. Outsped by a ton of common Pokemon who might be able to KO or cripple it without a Grass move. If they have a decently powerful Grass move, then it's gg Mega Swampert. Hippowdon, Tyranitar, Abomasnow,Ninetales, and Mega Charizard Y can all play weather mindgames with Mega Swampert, Abomasnow usually carries Wood Hammer, and Ninetales/Mega Char Y can both outspeed without a positive speed nature and without even using full EVs and commonly carry Solarbeam to murder it. Some other Pokemon with Grass Knot or another powerful Grass move who could KO include:
Specs Keldeo HP Grass (75% chance to OHKO 252HP/0SpD Mega Swampert after Rocks, clean OHKO if no bulk investment), Latios Energy Ball (Scarf Energy Ball even OHKOs non-bulk with an over 80% chance to OHKO bulky variants after Rocks. Spces/LO kill even bulky variants), Thundurus-I Grass Knot OHKOs I think, but I'm not certain (you can't change weight on the damage calculator lol) and LO definitely KOs, Protean Greninja Grass Knot OHKOs, LO Infernape Grass Knot OHKOs if 252 SpA I think (again weight is unchangeable), Skymin (lel) Seed Flare is overkill, Serperior Leaf Storm tho, LO Ludicolo Giga Drain OHKOs and Energy Ball non-LO OHKOs and speed ties, Breloom Bullet Seed (2 hits) KOs bulky variants and speed ties. There are probably more than this, but that's all I can think of atm.
In rain:
Any base 110 scarf or faster outspeeds Mega Swampert in rain. So, Scarf Latios Energy Ball, Scarf Greninja Grass Knot, Scarf Skymin Seed Flare, Swift Swim Ludicolo LO Giga Drain or non-LO Energy Ball (speed tie), Scarf Espeon Grass Knot (rare, but usable). Besides, if Politoed sets up Rain, it only gets 3 turns, and if it sets it up for itself it only gets 4. You can simply stall out the rain.
Mega Swampert can be defeated. Most decently powerful Grass moves can kill it, or you can simply stall out rain. Even in rain, Mega Swampert is still outsped, as base 70 speed is pretty low. It also hates burns as they lower its attack, and Toxic puts a timer on him. Paralysis (through Glare/Stun Spore) wrecks his speed as well. Freeze and Sleep obviously stop Mega Swampert from doing anything. It is very susceptible to status, very weak to grass, used less than 2% of the time, and is slow. You can hit it on the switch, or when it sets up rain, and then priority can finish it off. Mega Swampert isn't that big of a problem.