Hamburg lawmakers approved a $562 million investment in Hapag-Lloyd that makes the city state the biggest shareholder in the German ocean container carrier.