Retailers battling banks over debit-card transaction costs were handed a victory by a U.S. judge, who said that merchants were overcharged billions of dollars under an unlawful swipe fee set by the Federal Reserve, Bloomberg News reported yesterday. U.S. District Judge Richard Leon ruled yesterday that the Fed considered data it wasn’t allowed to use under the Dodd-Frank law in setting the cap on debit-card transaction fees, known as swipe fees, at 21 cents, and neglected to bolster competition in card networks. The decision, unless overturned on appeal, will force regulators to revisit rules that bankers said would cost them 45 percent of their swipe-fee revenue. Lenders collected about $16 billion annually from those fees before the Fed’s regulation and responded by cutting back on perks such as rewards programs and free checking to soften the blow to their profits.