There are situations in REO / bank owned purchase agreements where the earnest money is not refunded. It all depends on the contract being used to make the purchase and the language within that contract.
I think most of the responders to this question missed the headline 'Foreclosure in 77079"
If you have a specific question make sure you ask a knowledgeable person in the state where the property is located.
Best of luck .. Bruce
which is something very different:
Normally, since the money is in Escrow, it is applied to either the down payment, (which is also in the same account,) or the Closing Costs (which, you guessed it; is in the same account).
All this assumes that the DEPOSIT was given to the Title Company; I understand that sometimes the Deposit is given to the LISTING BROKER or the ATTORNEY, and is kept separate. About that; I cannot speak.
Good luck and may God bless