The credit card companies reached a settlement in a class-action lawsuit that accused them of inflating fees at certain bank-operated ATM machines.