I am not sure of the legal ramifications, since you do have a contract w/them and the contract requires you to pay rent. They can come after you for rent and any damages suffered b/c you didn’t pay the rent. You lawyer friend would know better.
On principle and intuition, I’d want to tell them to apply the deposit, especially since you’ve taken such good care of the place and unlikely you’ll get the deposit back, as you suspect and you’d end up going to small claims, get a judgement and maybe still not collect.