The EA absolutely does apply to how children are treated by teachers. See Part 6, Chapter 1 and schedules 11, 13 and 17 - i.e. sizeable chunks of the EA deal with children in education, including how they are treated by teachers.
There is no hierarchy of laws. All primary legislation has equal status.
If a pupil (via their parents) brought a discrimination case against a school for something they did for safeguarding reasons, but which the EA nevertheless said was unlawful, then the school would lose. The judge would not decide that safeguarding laws took precedence although they would hopefully highlight the incompatibility of the two laws and the government would then hopefully amend the law to remove the conflict.
Re: keeping secrets from parents - there is nothing in the EA that would make that a requirement for certain groups of pupils. If a school had a sensible blanket policy of never keeping secrets except when required by safeguarding law then a pupil with the PC of gender reassignment could try to argue that this was indirect discrimination - the same rule applied to everyone has a disproportionate adverse effect on them.
However, indirect discrimination is lawful if it is a proportionate means to achieving a legitimate aim. The legitimate aim here is safeguarding. Telling parents all important information about their children is a proportionate means of achieving this aim and is therefore lawful.
The EA does not apply directly to interactions between school pupils, however schools are bound by the public sector equality duty which means they must have due regard to eliminating discrimination, advancing equality of opportunity and fostering good relations between those who have a PC and those who don't. So if they allowed discriminatory behaviour to go unchecked between pupils they would be failing their PSED.