A judge who questioned whether Barclays Bank was getting off too easily nonetheless approved a deal likely to enable the bank to avoid prosecution over claims that it engaged in $500m (€390.4m) in illegal transactions with banks in Cuba, Iran, Libya, Sudan and Burma for more than a decade.