I am not aware of differences in banks and credit unions with reference to right of offset.
That being said, there may be a question concerning using social security deposits to offset, but I do not believe this question would be applicable to income tax refunds.
In my opinion the bank was within in rights to offset the deposit. Banking relationships are important, so keep talking to your bank and make sure they understand how you are going to honor your debts.
_________________________
My opinions may not reflect those of my employer.