So, the robot apocalypse might be technological singularity to some extent or it's electronics coming to life, or both. We are isolated and have difficulty learning what transpired in every country, and rendered information transmission almost extinct. Limited help from other countries except for the cities near borders. Depending on the scenario, we might get screwed up in a night and go for the mechanization ending.
If a zombie is defined as a man-eating creature, then finding out how the infection gets under your skin is the priority, or do they always infect through a bite. If the rate is so slow, we could easily learn it from patient zero to develop the vaccine quicker. If it's too late but the infection rate might not be that fast, then it will depend on the zombie types as people mentioned above.
World War Z is pretty scary but personally, I'm scared of zombies from I Am A Hero because they possessed their talents, skills, or habits when they were humans. Like that one zombie that can effortlessly jump several stories and murder every survivor. But among the options, the zombie is the most common and anticipated due to countless of fiction, so to me, it's less threatening compared to robots.
First contact with extraterrestrial life might not be that bad but too bad it's already in the phase of the invasion, which means their technology allows large-scale interstellar travel. Similar to zombies, depending on what kind of aliens they are but I won't fear any of them except Mimic from All You Need Is Kill because they can create a loop and can restart the day until they win. More importantly, they just want to destroy you. However, since we knew how to escape the loop plus we get a superpower but the scenario in the manga is due to an accident so it might not be that bright of an idea. But hey it's fiction, they have exoskeleton armor and the physics used a hypothetical particle which means confirm it as theoretical at the time and we can still survive too somehow using our brain.
For other scenarios, we might get enslaved, bred, colonized, or they were just looking for planetary resources. Chance is you can become the child of the sun in exchange for leaving mankind.
Lastly, if unkillable undeads come out from the underworld then yeah no, no chance at all unless other elements like magic exist that can purge them. Maybe, somehow, you can breed gods.
So I'd chose zombie because more survival chance.