whether it works or not depends on the species, and the colony
i have Myrmica rubra ants and they walk right over it
This is strange as i have 2 myrmica colonys.. the one walks over vaseline and the other goes nowhere near it.
All my colonies will walk across vaseline. I only use it on the lids to make them more airtight. My rubra can't cross PFTE but it needs to be applied regularly, as their nest is moist it's gets a lot of condensation.