Guess how it got to the point that evolving used up the last of its energy? By battling Kukui's Incineroar to the brink of exhaustion and the evolution was likely an unavoidable release outlet from the stress of the rivalry/battle - but inadvertently pushed it over the brink.
It doesn’t really matter the point was the battle was called a win. Just because Torracat fainted after evolving doesn’t make it a tie because the battle between Torracat was already over and it fainting happened between the time when the Pokémon that were battling next would be coming out.
Basically if Torracat and Incineroar has been Ash’s and Kukui’s final Pokémon and we had the situation that happened, it would not mean that suddenly Ash and Kukui tied.
Because Ash would still be declared the winner and Kukui’s Incineroar was clearly knocked out while Torracat was still standing when the match was called so it’s irrelevant if it fainted after evolving because it still won and wouldn’t be a tie.
Basically the evolution was Torracat’s way of celebrating that it won and it finally beating Kukui’s Incineroar.
Plus it’s not the first time a Pokémon pretty much fainted after the battle. I mean heck look Ash Ash’s Grand Trial Battle against Olivia, in the battle right after Ash’s Rockruff beat Olivia’s Lycanroc and was declared the winner with Ash winning the Grand Trial Ash’s Rockruff immediately collapsed and yet that didn’t override the previous call.
Basically if we’re using your logic here then Ash tier with Olivia, however clearly no one would really argue that it was a tie, and still would say that Ash’s Rockruff won and yet here you are trying to argue that Torracat somehow tied with Incineroar even though the situation is or similar to Rockruff vs Lycanroc.