A South African court dismissed a case brought by A.P. Moller-Maersk A/S against a port-expansion deal awarded to a firm headed by Filipino billionaire Enrique Razon, paving the way to expand the continent’s top container hub.