AI will be the robots that take over everything.
It's estimated in 5 billion years, the Sun will expand to the point that it envelops the Earth, so that's it, all gone.
In a billion years, we will run out of an atmosphere, all life will be long gone before the planet is.
The only hope to possibly save that life is that if humans could develop the technology to go out into space, bringing the genetic material of as many creatures as possible to perhaps one day settle elsewhere. Sounds like a lot of science fiction and probably not at all possible, but the only chance of saving anything from Earth in the long run would be humans.