So while the Wildcats learn a few hard lessons of the workplace (bosses can be mean!), Sharpay attempts to seduce Troy with the possibility of the ambitious life, which could result in a basketball scholarship to the University of Albuquerque. Heady stuff, and our boy is tempted, much to the dismay of his friends (hence Gabriella's sad song). But this is Disney, which is to say not Ayn Rand, and so the needs of the individual will always bow to the collective, with the requisite ginormous dance number.
Of course, this shows a misunderstanding of Rand in that it's not the "collective" winning out if he really thinks it's important to follow through with his friends. If he did it because his friends made him feel guilty and he really wanted the basketball scholarship and went with his friends begrudgingly and with resentment, then the interpretation would be right. As it stands, it is Disney, and a Disney kid would think it was more important to stick with his friends than to see himself with a really promising future. Go figure.