While religion often creates conflict as its adherents feel the need to force their beliefs on others, even though their religion actually teaches compassion (silly assholes), it perpetuates that conflict through the worst possible usage of the war machines you used as a scientific example of harm to the world.
For a real conversation on this you have to set some boundaries and in that rule out extremism actions of minorities. After all, if you are going to argue it could be a nuke, then I'd argue it would more than likely be a religious extremist that used the nuke. Or since we're talking hypotheticals, it could be just as easily one or the other.
So focusing on the majority plausible scenarios that have a basis in either purely religious root causes or purely scientific root causes, I'd have to say that sciences is the more likely destruction of human life. Though that doesn't mean it should be halted or stopped. Just that it has higher set of risks that need to be managed well.
Reasoning:
For religion to be a root cause that destroys humanity, it has to be such that a body of people are able to instigate a large enough conflict where military power destroys us all. This is definitely possible and the rise of Christian extremism in the US is an example where I fear there is a real plausibility of this to occur. But this is very much a limited plausibility at the moment and more than likely to trend away over time. (hopefully)
For science to be a root cause that destroys humanity, it is more simply a set of testing and scientific discovery that creates either a mistake or a tool that fails or is used incorrectly. AI is a potential threat. Genetic manipulation is a potential threat. Virus testing for cures is a potential threat. There are so many scientific investigations and discoveries going on that could result in catastrophic failure should the wrong outcomes happen. This is the basis of many movies of course but very much a real possibility. I see this as actually being a more realistic scenario aside from a warmongering asshole (religious or not) creating a world-wide conflict.
So, purely hypothetical mental model that looks at the most plausible scenario is one based on science, not religion, that kills off humanity. Unless an alien race kills us off because their religion says they are the only true beings of God.







