That's maybe possible, but:
The "end of the universe" can happen in some ways. One of them is the "big freeze" - the galaxies may go far from each other, the starts may die, and so on. In that way, there is no reason why the AI can't "live forever" - it might be a big computer float in the space, far away from anything, and it will be close system so the energy won't run away.
Done