Religion will survive. It survived learning the sun didn't revolve around the Earth. It survived learning disease wasn't caused by demons and that Zeus wasn't hurling lightning from Olympus. It survived evolution and the Big Bang. People will say the mysteries of God* were just greater than they realized, and their mythologies will start to seem a bit more like Star Wars.
You're correct. Religious belief is an evolved memetic/genetic survival mechanism.
Those parts of the human brain were never about logic and accurate observation of the material world - so they are safe from new facts and logic for now.
Probably at some point (assuming we survie), our own genetic/cybernetic modifications will so increase our intelligence, that religion will fall away completely... but that's beyond the Singularity.
* or what have you