Two shipping companies agreed to pay $2 million in penalties after pleading guilty to federal charges related to the dumping of oil in the Atlantic Ocean by a ship bound for New Orleans last year.