The general assumption made while learning rishonim (and even more applicable to ammoraim and tannaim) is that they meant what they said, they are consistent with their own shitos/halachic positions throughout their commentaries, and that they knew all of (or most of) the alternative explanations and still chose to explain it the way they did.
So when Tosfos asks a question on Rashi, we assume that Rashi knew that the question could be asked on him, and he still gave his explanation.
The next step is to ask- why wasn't Rashi bothered by Tosfos question? Usually, the commentators will explain how Rashi could answer the question. Then the question goes back on Tosfos- didn't Tosfos know that Rashi could answer the question? So what was Tosfos asking?
Usually in in-depth "iyun" learning, you would go back and forth until you finally resolve the machlokes. Generally, there ends up being a specific fundemental point upon which Rashi and Tosfos disagree. Rashi makes sense if you assume X and Tosfos makes sense if you assume Y. The machlokes is whether you assume X or Y.
(The next step- trying to bring proofs as to which assumption is better, and who else agrees with either assumption, and which assumption is accepted as law, etc.)
This is why we refer to it as a machlokes- we assume that both positions are correct and that Rashi didn't recant (unless we have proof that he did.)
While there are numerous works of the achronim who make this sort of analysis between Rashi and Tosfos, one of the classic one is called מגיני שלמה- "Defender of Shlomo." He writes that the purpose of his sefer is to defend Rashi against the questions of Tosfos. His general approach is to show how Rashi made different initial assumptions, or that he disagreed with an extrapolation, and thus Tosfos's questions aren't really questions on Rashi.