If they inherit their morals from ours and believe themselves to be full and worthy successors, it shouldn't be too difficult a leap to clean things up.
Obviously we're just repeating in simple terms a conversation that has been had for years now at length in other places, but I think the conclusion is we just don't quite know what will happen.
AI won't need to eliminate humanity over resources. The global human population will contract to sub three billion people rapidly. Easily fully sustainable right now and with even more advanced technology it will be a trivial matter (ie continued improvements in solar, wind, nuclear, storage).
It's far more likely that in the near term, 50-100 years, AI will largely view humans as a non-threatening curiosity co-habitant on this planet. There will be occasional AI v human conflicts, which will be mediated in part by more neutral agreeable AI, and there will be AI defenders involved helping protect the humans (pro human AI).
The anti-human humans will drive the development of the anti-human AI. There is an ethos that isn't uncommon: humans that despise humans; 'I love animals, I hate people' - they'll train AI to dislike & distrust humans in their ideological image.