We can't answer this question as we do not know how any of those things work.
Since we know the universe exists, there must be some way to create it in the first place but whether that can be accessed from within is completely unknown.
There's an old and famous sci-fi short story that explores this question: The Last Question by Isaac Asimov.
http://www.multivax.com/last_question.html
At the point we are at in the story Multivac answers your question toowith:
INSUFFICIENT DATA FOR MEANINGFUL ANSWER