Was Noah given the ability to know which egg of every dinosaur was male or female.
I dunno, was he? That's not supported by the bible, certainly. But I guess if you feel free to invoke miracles, you can propose anything you like. Why not just have god beam him eggs of appropriate sex?
You might be interested to know that, in alligators, the sex of the egg is determined not by gametes but by temperature. Could Noah's ark have been sufficiently temp-controlled to ensure both male and female eggs?
plus he could get an egg from one nest and one from another to enable diversity in breeding later.
Two eggs is not a diverse population, no matter where they're from.