I question this.
Neither I nor Wikipedia should be used for legal advice, but there are exceptions to discrimination law, and the parent's comment seems to precisely meet one of them:
Assuming absolutely identical skills, experience, education, etc, then you are legally entitled to apply positive action in favouring a woman. Attempting to defend that position in a UK employment tribunal however, would be near impossible.