Troy was lead to believe- by Gabriella- that Ryan was trying to move in on Gabriella and steal her from Troy.
Gabriella breaks up with Troy.
The next time that Troy speaks to Ryan, he apologizes to him for all of Ryan’s hard work choreographing an act for the Wildcats in the Lava Springs talent show seemingly going to waste,
expresses that he’s “looking forward” to watching Ryan play baseball, and caps it off with-
FYI: Troy was single, at this point in the movie.