All praise is due to Allah, and peace and blessings be upon our master, the Messenger of Allah.
An employee is a hired worker for the body he works for, and he is a trustee in his work. He must observe the regulations and instructions issued by that body concerning the work and adhere to them. He may not act except within the limits of what he is authorized to do. It is not permissible for him to sell these books or give them away in his own personal name, for this is considered transgression and consuming public funds, which is forbidden suḥt (unlawful gain) that is never lawful under any circumstances.
Accordingly, the principal is a trustee over what is in his hands, and he must adhere to the instructions issued by that body regarding the sale or gifting of the books. If the instructions allow it, it is permissible to dispose of them. If they forbid it, doing so is forbidden. The duty then is to return the surplus books to the Ministry, or to seek its permission to sell them and place their proceeds in the school's favor. And Allah Almighty knows best.