If a -2 or disadvantage is worse will depend entirely on what the scenario is. For starters, is it a skill check/saving throw or is it an attack? A 20 on an attack roll is always a hit because of it being a critical, but this is not true for other checks.
So some examples:
I am attacking Bob the Knight and I need a 20 to hit.
Here, disadvantage is clearly worse, because my chance of rolling a 20 will go down, while a -2 to hit would make zero difference, I already needed a 20 anyway.
I am attacking Bob the Mage and I need a 2 to hit.
With a -2 I would need a 4 to hit. With disadvantage, I would need to not roll 1 on two dice. The chance that I roll a 1-3 on a dice is 3/20 = 15% chance. The chance that I roll a 1 on two die is 39/400 = 9.75% (see here for an explanation). In this case, it is better to have disadvantage because the chance to fail is less with disadvantage than with a -2 on the roll.
I am picking a very difficult lock and I need a 20 to succeed.
This is different from the attack scenario, because in this case, a 20 is not a guaranteed success. The moment I get -2 on my dice roll, I can no longer succeed at all! (Unless you're using a commonly used houserule that skill checks can also crit and always succeed, but this is not actually RAW.)
In this case, disadvantage would obviously be vastly superior, a chance of rolling 20 on both die is clearly higher than the chance to roll 22 on a single 20-sided dice.
In general, disadvantage tends to be worth around -5 is the common 'shorthand' for how bad disadvantage is, but it clearly depends on the circumstances. In some cases, even a -1 will make a roll completely impossible.
There are even compiled tables that compare this sort of problem, using a roll you need to hit (the DC) to how much of a penalty that roughly equals to:
DC 2 = Disadvantage = -0.95 to hit
DC 5 = Disadvantage = -3.2 to hit
DC 10 = Disadvantage = -4.95 to hit
DC 11, Disadvantage = -5 to hit
DC 12, Disadvantage = -4.95 to hit
DC 13, Disadvantage = -4.8 to hit
DC 14, Disadvantage = -4.55 to hit
DC 15, Disadvantage = -4.2 to hit
DC 16, Disadvantage = -3.75 to hit
DC 17, Disadvantage = -3.2 to hit
DC 18, Disadvantage = -2.55 to hit
DC 19, Disadvantage = -1.8 to hit
DC 20, Disadvantage = -0.95 to hit
TL;DR: In general, disadvantage is worse than -2 to hit, but there are edge cases.