All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
You should try to find a way to leave this group and find another group of males with whom you would not fear for trouble in your religion, and whose company does not bring sin with it. If you fail to find another group and have no other way but to stay with your current group, and you have to carry on with your studies, then you are advised to be mindful of Allaah to the best of your abilities and be cautious when dealing with the females and with that homosexual and also to kindly try to give him advice.
Also, you should limit your presence with them to the class and study hours and do not stay with them any longer if there is no need, then leave them to be with your family, to be safe from the evils of such company.
For more benefit, please refer to Fataawa 84281 and 90305.
Allaah Knows best.