The Torah at the beginning of Shlach tells us that Moshe called Hoshe'a by the name Yehoshua (see Ramban re: exactly when his name was changed, as he was called Yehoshua already earlier in the war against Amalek), adding the letter yud to the initial k-ey, because Moshe davened that "K-h yoshiacha mei'atzas meraglim," that Hashem should spare Yehoshua from the plot of the spies. The Maskil l'David asks how such a tefilah could work. Every person is given the opportunity of free choice. How could Moshe ask Hashem to stop Yehoshua from falling prey to the temptation of the spies' plan -- wouldn't that mean interfering with his freedom of choice?
(You could learn Rashi that Moshe was davening that Hashem protect Yehoshua from any potential plot to kill him that the spies may have been planning, but I think if you take this approach you get involved in the thicket of problems we've discussed a bunch of times in the past about whether hashgacha overrides human's ability to choose and act freely.)
This is different than the gemara (Shabbos 156) where R' Nachman's mother, after hearing from astrologers that he would grow up to be a robber, told him to always wear a yalmukah and to daven that he be spared that fate. Maharasha asks: how can you ask Hashem to sway your free choice? The Tiferes Shlomo similarly asks how we daven each day, "Hashiveinu Avinu l'torasecha..." Aren't we asking Hashem to tip the scales and make our choices easier? I think the answer (the Maharasha answers a little differerntly, though maybe this is what he means) in those cases is that the tefilah itself is an expression of choice. The very fact that a person would daven for yiras shamayim and Torah already means he/she has made a choice to go in the right direction and just needs some help getting there.
The case of Moshe davening for Yehoshua is similar to the gemara (Brachos 10) where Bruriah tells R' Meir that rather than daven for the evil people in his neighborhood to be punished he should daven for them to do teshuvah. In both these cases it is a third party -- Moshe, Rabbi Meir -- who is making the choice to daven. The person who is the beneficiary of those tefilos remains passive, not making any choice or committment, perhaps not even aware of the tefilos said on his behalf. The Maharasha in Brachos asks how do you square this idea of asking Hashem to tilt the scales of free choice for someone with the rule that "hakol b'ydei shamayim chutz m'yiras shamayim?" He concludes simply, "yesh l'yasheiv." Good Luck doing so!
(Rav Dessler touches on this issue if you want an answer. I'm not sure I fully understand it.)