It's more complicated than that. Yes, Lord Kelvin believed in a young Earth (although one that was still millions if not billions years old, not one that was merely thousands of years old like some religious literalists), but it isn't entirely true that this was out of religious conviction. It's that he (and everyone else) didn't know about radioactivity. He modeled the maximum age of the sun assuming it was a combusting body in the conventional sense without understanding the nuclear fusion which was going on inside it. The people who predicted (correctly) that the Earth had to be billions of years old for the amount of evolution to have happened were of course correct, but they didn't know how the sun could work either.