Imrahil doesn’t try to ignore the hopelessness of the situation, but his decision to reserve some troops to defend Minas Tirith shows that he can envision a situation in which hope prevails in some form. Put another way, he’s able to hold doom in one hand and faith in the other rather than submitting to one the other. Gandalf is more optimistic about their strategy’s success, because he knows that Sauron, though powerful, is still threatened by the symbolic strength Gandalf and Aragorn possess.