Let the music play
Between Magneton, Dugtrio, and Tyranitar (which isn't that common of a trapper in RSE since the only major target he would have is Gengar, but he is in DPP) you can't ever really be safe.In RSE OU, how do I not get trapped by Magneton and Tyranitar? I can't be sure my opponents don't have a trapper until I reveal all 6 of their Pokemon, and I don't want to wait until then to use my trap-able Pokemon.
In RSE, Skarmory is the most common Magneton target, and you'll see many players do the following: either accept their fate and build their team around capitalizing on only getting 1 layer of Spikes, using Whirlwind on the first turn that Skarmory is out to try and scout for Magneton, or double switch immediately for the same effect. Ultimately, Magneton is pretty much useless outside of KOing Skarmory though, so it's easy to take advantage of once it's out, being setup bait for a number of Pokemon. Dugtrio is a lot harder to play around, but he's also much more difficult to get in safely so he's largely only used for revenge killing. He also has a tough time getting KOes without Choice Band, which means if he locks himself into Earthquake he's setup bait for a large number of Pokemon, especially DD Mence and Gyarados.
Basically, it's important to have a gameplan from the beginning to know what to do if you get trapped and build your team to know how you're going to capitalize on the trappers once they're exposed (if they're present). Your opponent bringing a trapper also means your opponent has gaps in their team's type coverage and indicates strongly that they're team is offensively-inclined (especially if they bring both, this means they're basically playing with 4 mons and 2 disposables), allowing you to adjust your gameplan accordingly and to find where their gaps are.