That also sadly wouldn't hit. But Gastrodon is a great counter against Rotom-W thanks to her ability Storm Drain which makes it immune to Water STAB, and being ground type, it's immune to Electric STAB so I would definity keep her in your team to toxic stall him.
But if you want to deal with it quickly I would recommend using a life orb Excadrill with mold breaker. Then you will be able to hit Rotom-W with earthquake.
I made a quick damage calc and found out that you can take Rotom-W out in 1 hit with these EVs 120HP/136ATK/252SPDef
136+ Atk Life Orb Mold Breaker Excadrill Earthquake vs. 252 HP / 212+ Def Rotom-W: 315-374 (103.6 - 123%) -- guaranteed OHKO
It also will survive a hydro pump from Rotom-W for sure
0 SpA Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 254-302 (64.9 - 77.2%) -- guaranteed 2HKO
252 SpA Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 320-378 (81.8 - 96.6%) -- guaranteed 2HKO
The only Rotom you should be afraid of then is Choice spec Rotom-w as it will probably take it out in one hit
0 SpA Choice Specs Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 380-450 (97.1 - 115%) -- 81.3% chance to OHKO
The downside to this is that you will have two pokemon who are weak against water/no way to counter that.
But if you want to deal with it quickly I would recommend using a life orb Excadrill with mold breaker. Then you will be able to hit Rotom-W with earthquake.
I made a quick damage calc and found out that you can take Rotom-W out in 1 hit with these EVs 120HP/136ATK/252SPDef
136+ Atk Life Orb Mold Breaker Excadrill Earthquake vs. 252 HP / 212+ Def Rotom-W: 315-374 (103.6 - 123%) -- guaranteed OHKO
It also will survive a hydro pump from Rotom-W for sure
0 SpA Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 254-302 (64.9 - 77.2%) -- guaranteed 2HKO
252 SpA Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 320-378 (81.8 - 96.6%) -- guaranteed 2HKO
The only Rotom you should be afraid of then is Choice spec Rotom-w as it will probably take it out in one hit
0 SpA Choice Specs Rotom-W Hydro Pump vs. 120 HP / 252 SpD Excadrill: 380-450 (97.1 - 115%) -- 81.3% chance to OHKO
The downside to this is that you will have two pokemon who are weak against water/no way to counter that.