There is no indication Naruto was evaluated based on his fight with Mizuki. It was a life and death battle which Iruka was also fighting in, so he didn't stop and start keeping track of Naruto's points. Naruto still failed the examination, but was given an exceptional pass (either for fighting Mizuki, or for mastering the Shadow Clone Jutsu), similar to Rock Lee, and allowed to graduate. Naruto's failures, including the last one, likely still exist on his record. Since the final examination was merely the Clone Jutsu, it's also unlikely there would be much variation in score, and is possibly just a pass/fail exam, and thus it wouldn't make much sense to talk about the best student and the worst student only based on this test. Mizuki does ask if they should pass Naruto based on his stamina and endurance, but it isn't clear why (Are these criteria evaluated for the Clone Jutsu? Were there additional parts of the test not shown? Is he just looking at Naruto's past academic record and making a dumb suggestion based on it?).
With all that being said, there is also little reason to believe the teams were formed based only on the results of the final examination, as I will show.
In the third episode, Sasuke and Sakura: Friends or Foes, Iruka explains why he put Naruto and Sasuke together. Iruka comments on their grades. This is what the English subtitles on the Japanese dub on Crunchyroll say (emphasis mine):
Sasuke has the best grades of the graduates. Naruto, you're at the bottom.
The fact that grades is plural here indicates Iruka isn't just talking about the result of the final test.
The next thing Iruka says is:
Of course, this is how it is when trying to balance the strength within groups.
Considering it only covers one jutsu, the Clone Jutsu, the results of the final test alone would be a poor guide to trying to balance the strength of the teams, so of course, their overall performance up until now was considered.
Also, Naruto had the audacity to call himself an exceptional student, so that also points to Iruka rebuking him with their overall experience at the academy, rather than just the final exam.
Additionally, much later we learn how the other teams were formed, and some of them have nothing to do with anything learned at the academy. Ino, Choji, and Shikamaru were put together to mirror their parents' team, for instance, because of the power of the Ino-Shika-Cho formation. And Hinata, Shino, and Kiba were put together because they all have sensory abilities. This all points away from a single test having been used to put Sasuke, Sakura, and Naruto together. The Hokage also has a hand in creating and approving the teams, so it's possible Iruma wasn't aware of the real reason these three were put together.
For anyone interested in this question, I highly recommend Naruto Shippuden episode 361 (Kakashi: Shadow of the Anbu Black Ops-Squad 7), as it pretty much goes through a lot of what I've discussed. It even makes it pretty clear the teams were made by the Hokage, not by Iruka and the academy, as Iruka, while looking over the Team 7 roster says something like, "Ah, brilliant! Sasuke got the best grades and Naruto got the worst grades, so this team is perfectly balanced!" And thus, like I said, it's pretty clear Iruka is kind of misunderstanding this here, but he's pretty confident in his conclusions, which is why he repeats it with such confidence to Naruto later. This episode also makes it clear one of the reasons Kakashi was made their team leader so he can teach Sasuke how to use Sharingan, since he's the only Sharingan user left in the village.
Considering it was well-known enough that Sharingan could control the Nine-Tails that the Uchiha were suspected of being responsible for the Nine-Tails rampage, it's possible Sasuke was put on the same team as Naruto to keep the Nine-Tails in check. This is definitely touched upon in the aforementioned episode 361 and maybe mentioned other times in canon. While Kakashi and the Third Hokage are discussing team seven, Kakashi says something like, "The nine tails Jinchurki... and one who might awaken the Sharingan." He doesn't draw an explicit connection there, and the Third Hokage doesn't actually confirm it as a motivation for creating the team, but they definitely mentioned the Sharingan being a power able to control the Nine-Tails in this arc.