Yeah X Factor has something in their T&C's about this too when crowning the winner, I remember reading it a few years ago
Basically if the vote is tied they aggregate all of the previous votes cast for the two finalists across the weeks to determine the winner, and if
that vote still ties (yes there's a contingency plan for that too), then the judges determine who win. There wasn't anything to say what would happen if it went to deadlock though