Both versions are ambiguous without any context. There is a tendency to interpret "das" as correlate that refers to the situation, and a tendency to interpret "es" not as a correlate, so as referring it to the baby, but these tendencies are weak and can easily be overruled by the context.
So, let's add some context:
"das" as correlate
Das Baby war hungrig, aber das sah er nicht. Er betrachtete das Baby schon eine Weile, aber es kam ihm nicht in den Sinn, dass es Hunger haben könnte.
Here the word »das« is a demonstrative pronoun that refers to the whole situation (the baby suffering hunger). So it acts as a correlate here.
"das" not as correlate
Das Baby war hungrig, aber das sah er nicht. Er sah die Mutter und den Vater, und er sah sogar den Hund, aber das Baby entging seiner Aufmerksamkeit. Das sah er einfach nicht.
Here the word »das« is also a demonstrative pronoun, but now it refers to the baby who's grammatical gender is neuter. So it doesn't act as a correlate here.
Demonstrative pronouns can be used instead of personal pronouns in many situations. Very often this has a rude and pejorative connotation, but it's still grammatically correct. But now the gender of the pronoun has something to which it must match, namely the grammatical gender of the person or thing to which it refers:
masculine: Der Mann war hungrig, aber den sah er nicht.
feminine: Die Frau war hungrig, aber die sah er nicht.
neuter: Das Kind war hungrig, aber das sah er nicht.
So, the ambiguity exists only, if there is something that has a neuter gender:
feminine: Die Frau war hungrig, aber das sah er nicht.
Here we still have a neuter demonstrative pronoun, but no neuter noun to which it could match. So now it's clear and absolutely unambiguous: The word das is a correlate that refers to the whole situation.
"es" as correlate
Das Baby war hungrig, aber er sah es nicht. Er betrachtete das Baby schon eine Weile, aber es kam ihm nicht in den Sinn, dass es Hunger haben könnte.
Here the word »es« is a personal pronoun, that refers to the whole situation (the baby suffering hunger). So, this personal pronoun acts as a correlate here.
"es" not as correlate
Das Baby war hungrig, aber er sah es nicht. Er sah die Mutter und den Vater, und er sah sogar den Hund, aber das Baby entging seiner Aufmerksamkeit. Es sah es einfach nicht.
Again a personal pronoun, but from the context you know, that it now is not a correlate, so it refers to the baby. And if it's not a correlate, it has to match to the gender of the referred noun:
masculine: Der Mann war hungrig, aber er sah ihn nicht.
feminine: Die Frau war hungrig, aber er sah sie nicht.
neuter: Das Kind war hungrig, aber er sah es nicht.
And again, if the pronoun is neuter, but if there is no neuter noun around to which it could match, then it's clear and unambiguous that it's a correlate that refers to the situation:
Die Frau war hungrig, aber er sah es nicht.
About word order: