Visa and Mastercard have reached a revised settlement agreement with US merchants in their decades-long legal battle over credit and debit card swipe fees, after a federal judge rejected an earlier $30 billion agreement as insufficient.