If the result is a simple pass/fail where the level of success or failure doesn't matter then advantage and reroll on failure offer the same benefit assuming you get to choose which result from the reroll to accept.
I'm having a hard time following you. Are you new to 5th edition, Nagol?
"Advantage" means: roll two dice, pick the best.
A "re-roll" means: roll a die, decide whether to re-roll. If you re-roll, you must keep the second roll.
The context is on ability checks, attacks and saves. In almost every case, all that matters if you reach the "Difficulty Class" or DC, which is just a target number. (There are examples where it gets more complicated than that, such as specific ability checks where something extra bad happens if you fail the DC by five or more, but the OP didn't ask for that).
This is a friendlier way to say "of course it's a simple pass/fail - this is D&D"
At its best, reroll and advantage at the same. Constraints on reroll make it somewhat worse -- how much worse depends on the constraints.
I'd like you to read my post, and ask you how we could reach so disparate conclusions:
Ergo, you could say in this case the reroll is twice as good as the advantage, on average.
What I mean by that is that in both cases, you get to roll two dice.
But in the case of advantage you need to commit before you see the results of either.
While in the case of the reroll, you get to see the first result before committing.
If you have a 50% chance of success (the level where advantage grants a maximum benefit), you also have a 50% chance of not having to spend your reroll at all (simply because the first roll succeeded).
In sweeping terms, this makes me say a free reroll is roughly twice as good as a free advantage.