Three Massachusetts banks have signed onto a class action lawsuit claiming Target Corp. and security firm Trustwave Holdings Inc. should pay for expenses associated with the massive data breach last year that compromised some 40 million credit and debit cards. The suit was filed in late March in Minnesota, where Target is based. The banks, HarborOne Bank, Mutual Bank and Pittsfield Cooperative Bank, say Trustwave failed to maintain the security of Target's network. It and the retailer should pay…