9 (voice of Elijah Wood), 7 (voice of Jennifer Connelly), 3 and 4 survive the battle with The Machine and retrieve The Talisman. The Scientist (voice of Alan Oppenheimer) built 1 through 9 and divided his soul among them when The Machine, which he also created, was misused by The Dictator (voice of Tom Kane). The Machine built and army of other machines that destroyed humanity.
When 9 activates the Talisman, the souls of 1 (voice of Christopher Plummer), 2 (voice of Martin Landau), 5 (voice of John C. Reilly), 6 (voice of Crispin Glover) and 8 (voice of Fred Tatasciore), which have been absorbed by The Machine, are released and sail into the clouds. A rainstorm ensues with each drop containing the essence of the intermingled souls. It can be inferred that this rain will restore life to the world that 9,7,3 and 4 are now responsible for.
Thanks Evil Ed!