Answer:
In the name of Allah
By saying that the ghair mahram is “non-mature”, I take it that they are children. If a Muslim woman is alone with children who are her ghair mahram, then this is permissible. By saying children I am referring to those who have not yet reached the age of puberty and understanding of sexual relationships.
“And say to the believing women that they should lower their gaze and guard their modesty; that they should not display their beauty and ornaments except what (must ordinarily) appear thereof; that they should draw their veils over their bosoms and not display their beauty except to their husbands, their fathers, their husband’s fathers, their sons, their husbands’ sons, their brothers or their brothers’ sons, or their sisters’ sons, or their women, or the slaves whom their right hands possess, or male servants free of physical needs, or small children who have no knowledge of the relationship between the sexes; and that they should not strike their feet in order to draw attention to their hidden ornaments. And O you who Believe! Turn you all together towards Allah, that ye may attain Bliss.”
Quran Surah Noor, verse 31
From the above Quranic verse ?. or small children who have no knowledge of the relationship between the sexes, from the Tafaseers it can be concluded that children who have not reached the age of puberty and have not attained the level of understanding needed to distinguish or discern the specific matters to sexual relationships and women. Then those children will not need to observe Hijab from ghair mahrem women (Tafseer Ruhul Ma’ani Vol 9 Pg 213). This means that the Muslim lady may enter the children’s presence alone, even without her Hijab.
However, if there is a mature boy who acts and behaves immature or a non mature boy who understands the concepts of sex and women then it would not be permissible for a Muslim lady to be in his company alone and she should observe Hijab infront of him. Because the Quranic verse clearly points out that they have NO understand of sex. So if a child did have understanding then he/she would come into the category of other Mahram.s.
It is also important to note that in the contemporary, time female school teachers have experienced many ill cases. Hence, to exercise caution is advisable in many cases.
And Allah the Guardian Lord knows best.