The new pact replaces the 25-year-old North American Free Trade Agreement, which Trump had threatened to cancel.