Thank you for your question.
What is a legal heir?
An heir is an individual or person who inherits estate or property of his or her ancestor who died without a will
Hindu Succession Act
In this act if a Hindu male dies without leaving a will under class I of Hindu succession act there is list of relatives to who the property will go. Under class II of the act specifies the list of relatives if no one from the class I of relatives is alive. So basically both the class gives the number of relatives who could be considered as legal hair
In your case female inherited the property from her father and both of them are not alive. So next legal hair for the property are the two sons
Let me know if you have further queries