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 is His slave and Messenger.
Undoubtedly, what you mentioned about the education institutions in your country is a great source of temptation and this mixing is forbidden. In this regard, we have already published Fataawa 87469 and 87310 clarifying that it is not permissible to study in universities in which there is forbidden mixing between the sexes.
Indeed, if the male and female students behave in the manner which you described in the question, then this renders it more forbidden and studying in such institutes becomes more forbidden. The presence of a Muslim in such a place is dangerous for his religion. When he sees such practices, he becomes accustomed to seeing evil and he is present in such places without denying it, and this is one of the greatest reasons of spoiling the heart.
Therefore, you should avoid studying in such institutes, and you may join other institutes for male students only, and Allaah may bless you with means of sustenance after graduation from sources you never imagine. Also, you may look for a means to study in another country where studies are free from such prohibitions.
Finally, if we presume that you do not find a way to any of this, and the only alternative left is to either leave the studies or to study in those mixed institutes, then protecting your religion comes in priority as being safe in your religion is of unrivaled value.