It works on a first come, first serve basis. This is taken from a FAQ for Celestial Storm in Pokegym:
== LAZY (Slaking - SM:Celestial Storm)
Q. What happens if both Slaking with "Lazy" and Garbodor with "Garbotoxin" in play?
Do they cancel each other out or what?
A. It depends on the order in which each Ability gets activated. Both Lazy & Garbotoxin require a condition in order to activate (either being the Active Pokemon or having a Tool attached), so when one of the abilities is active the other one is prevented. But if the ability gets disabled (like if Slaking is no longer the Active Pokemon or if Garbodor loses its attached Tool), then the other ability can activate even if it was previously prevented.
So, if you put your slaking into the Active slot first, Garbodor's ability won't activate once it's given a tool. However, if you retreat, Garbodor's ability will activate, and even if you switch your Slaking back in, Slaking's ability won't work until you either remove the tool from Garbodor or KO the Garbodor.
Edited by Sakura150612, 09 December 2018 - 09:49 PM.