In a foreclosure the property taxes in arrears that were the responsibility of the original homeowner come before the banks leins and are paid first in a foreclosure or trustee sale. Then the bank, then if there are proceeds left, second mortgages and then other leins. The next buyer buys the home with clear title.
It may depend on your County,
It may depend on whether the County did indeed file a lien on the property; bureauacracies are noted for not filing paperwork and if they did not file a lien, they may be able to attach/sue the homeowner as a private, unsecured debt. (I know of this happening.)
You know what you need to do.
But either way at the closing the taxes should be brought current at the time of the closing between the bank and the buyer.
First Weber Group
Certifed Distressed Property Expert
The only time back taxes accrue on a property in foreclosure is when the homeowner's mortgage was set up so that the homeowner pays the taxes them self.