A male child would always take precedence over a female one.
Male-preference cognatic primogeniture allows a female member of a dynasty to succeed if she has no living brothers and no deceased brothers who left surviving legitimate descendants. A dynast's sons and their lines all come before that dynast's daughters and their lines. Older sons and their lines come before younger sons and their lines. Older daughters and their lines come before younger daughters and their lines.
This was the most common primogeniture practiced in Western European feudalism
If the girl child does not know, does that mean that other people do know?
In practice in this sort of case the selection of the child is pretty much a technicality and may well owe a lot to politics. A Regent would be appointed to run the kingdom in the child's name and would become King in all but name. The politics behind selection of the Regent and which child that Regent controls would likely have a larger impact on the results of the succession than the status of two illegitimate children.