A Connecticut bank has agreed to pay more than $7 million to investors who lost millions of dollars in Bernard Madoff’s massive Ponzi scheme but it also won a jury verdict involving two of the investors, attorneys said Thursday. The investors contended Westport National Bank failed at its job as custodian of their retirement accounts. The bank argued it met its obligations and was not responsible for uncovering the fraud. The bank, whose parent company is Connecticut Community Bank, reached a $7.7 million settlement last week with about 240 account holders, attorneys said. Investors put about $12 million into the accounts over the past 20 years, including about $5 million since the bank took over the account, said David S. Golub, attorney for about one-third of the investors.