Arnold saves the day by activating the generator that provides Mars with a breathable atmosphere. It's possible that it was all a dream. In the beginning of the film Arnold gets dreams implanted. While doing so, the technician looks at the tape of the implanted memory and says: "Blue sky on Mars. That's a new one." This is the exact ending of the movie.