Your GM decides what a Friendship Token is worth
Yes, the rules in the box on p. 47 you quote from say that you can give 3 Tokens of Friendships to automatically pass a challenge without needing to roll dice. But note what it says immediately after the box:
It's important to keep in mind that this is just an example [...] it's always up to the gamemaster, and his or her word is law.
This text is mostly about how many Friendship Tokens are needed to pass a test, but the wording here is still very clear that the resolution of paying Tokens of Friendship is always up to your GM. Meaning it would also fall into their jurisdiction to decide how much damage you deal if you automatically win a challenge with 3 tokens, or another amount decided by your GM.
Alea iacta est
You present three possibilities, which I will discuss shortly, however afterwards you state:
whether or not the opposing party rolls their opposed dice is also a factor
But you need to know that in this case the opposing party will always have already rolled their die (or dice). Why? Because when using Friendship Tokens in this way you are 'Changing a die roll', which is also the name of the header for that rules section. You are not forgoing rolling in general, you are rerolling or replacing your own die roll, that has already happened. This means that your opponent has also already rolled, otherwise you wouldn't know that you have failed the challenge. The text here on p. 46 states:
Maybe you, or a friend, have just rolled a die [...] and have failed to roll high enough for a success
How a challenge plays out
Now let's play out the scenario, so we are all on the same boat. So both you and your opponent have just made a challenge, i.e. you both rolled your dice for the same attribute. And it ends up that you have rolled lower than (or perhaps even equal to) your opponent and thus lost the challenge. Instead of giving up and accepting the bad result you tell your GM: "I would like to use 3 Tokens of Friendship to automatically succeed". You GM would then evaluate two things:
- Whether or not 3 Tokens is enough for this challenge, or if you need more or maybe even less. Which acccording to the rules would be 'depending on the importance of the Test or Challenge and the results of success and failure".
- What the result of your replaced roll is, if it is relevant. For this we don't have clear guidelines, but I will compile all possible options in the next paragraph.
How your GM can determine your replaced roll
I will now list all possible options known to me, that the GM can use to determine the result of a challenge roll replaced by Friendship Tokens to be an automatic success. To reiterate: which ever method is chosen is ultimately up to your GM, but each method has their pros and cons, which I will explain. I will begin with the three options you listed, then the one the previous answer mentioned and ending with one I came up with.
- Rolling a 20. This will often times be a good way to resolve it, but it's possible that even a 20 will not be enough to win the challangel, as there are creatures who have ability dice greater than a d20, such as the Cragadile in the main book, who as a d20 + a d10 for Body. If that Cragadile rolls a 21-30 on its opposed check, a 20 would still not be enough to beat it.
- Rolling your usual maximum possible result. This might be an option if your opponent has rolled relatively low, but I would usually advice against ruling it like this, as it will more often than not be lower that the average result of a D20, which is 10,5. And that is what you would get if you (normally) spend 2 Tokens of Friendships to reroll with a D20, but as you have (normally) spend 3 here, you should be rewarded for that with a better result, than if you had spend less.
- Rolling infinite. Your GM might decide this if they are willing to let you instantly defeat your opponent, knocking them to 0 stamina. This might not be a problem for a contest against a random Pony NPC, or even some stronger opponents like a Timberwolf. But you GM will most likely not want you to be able to defeat Lord Tirek at full power in a scuffle, just by using 3 Frienship Tokens. In such a case they might rule that it costs (way) more Tokens or that you do not deal that much damage, or both.
- Rolling 1 higher than your opponent. This will always guarantee that you win the roll, but also limits your damage output and might even punish your opponent for rolling high. With this method you will always win, but you will either always deal 1 damage (for your Stun Ray example) or deal what your opponent rolled + 1 (for scuffing). For the latter example this means your opponent will actually take more damage, the higher they rolled, penalizing them for rolling good, which might not be a good idea.
- Rolling your opponent's maximum possible result + 1. Meaning that if you rolled against the cragadile from my earlier example you would roll a 31. This again guarentees that you always win, like option 4, but this one also has some weird damage output inconsistencies like that options has. For the Stun Ray this will deal more damage the lower the opponent rolled, penalizing them for rolling bad, which seems like a good idea, but then for scuffing the amount of damage will depend on how high your opponent's attribute is, that they are rolling, basically penalizing them for having high stats. This is helped a little bit by the fact that a creature's stamina is determined by their Body and Mind stats, meaning with this method you are unable to instantly reduce an opponent who has full stamina to 0 (unless for some reason you are having a Charm contest, that also deals damage to the loser).