You are asking Yes/No is this Moral.
First you must define what is moral, oh Mr Spock. Principles vary from person to person and society to society.
The great debate over Utilitarian v Kantian ethics, the needs of the many over the needs of the few. A question that often gets faced, whenever there is a new drug put out, they now there is a possibility people who take this drug will develop serious health ramifiations or die, but it is a risk they are willing to take if it will save many more lives.
Next, there is the black and white issue of your poll. Assuming you want an answer as though it were real life and not some kind of "Press x to not die" video game, yes, there are always mitigating issues, there are always other things to try, but some are more probable than others.
Do you want people to press a button or have a debate? I would like to know what prompts you to ask such a question to know what your angle is in this.
One issue is how certain are you that the invaders will find you if the baby lives. How certain are you that the invaders will definitely kill all of you upon finding you. The answers to these questions and the certainty to their knowledge plays a large role in answering your primary question. Killing the child is not enough to ensure your safety. Even if you are discovered, what are the odds you could survive an attack? Overwhelm or escape your attackers?
If you were to change the scenario a bit, to instead of a crying child it was a wounded adult, would you abandon them to certain death or 'not leave a man behind' knowing that even if injured, they may be helpful to you later, and that all life is precious.