Until the bank forecloses, the owner is on the hook for the carrying costs, in theory. In reality, the bank isn’t likely to approve a short sale unless the owner is in default on at least one mortgage, which means they will be eating any missed payments. An owner in financial distress might also decide to forgo paying HOA dues/assessments, property taxes, and perhaps even utilities if the home is vacant. Unpaid HOA fees and taxes would create liens on the property, which would be cleared from the proceeds of any sale. That means in effect that the bank pays for them as part of its loss on sale. Sometimes government-owned utility districts can place liens as well. Private utility companies would send collections people after the old owner.
Once foreclosure happens, then the bank is on the hook for everything until it sells the property. That is one reason banks don’t like to carry large numbers of REO properties.