In a magical world, there are definitely ways to explain the temperature difference. But then how did Gandalf know the ring would be cold and the script visible, when his research suggested it would either get hot or not hot enough to show the letters?
But even if Tolkien had thought of this, I'm still incredibly impressed that my son noticed this detail. He might just be a future Tolkien scholar.