All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
There is nothing wrong in drawing lots amongst the students who have passed their school curricula in order to decide who will be allowed to change their specialty. This is not considered forbidden gambling where a person either gains or loses.
Drawing lots is a permissible means to decide the one who deserves (to change his specialty) if people do not know who exactly is the who deserves to be given this choice. Ibn Rajab said in Al-Qawaa'id:
"The draw (drawing lots) is used to distinguish the one who is entitled (to get something from amongst a group) if the entitlement is confirmed in principle to be given to someone, and this someone is not known, and provided that all people are equally entitled." [End of quote]
Allah Knows best.