The ruling denies the agency’s attempt to force the company to unwind its Instagram and WhatsApp acquisitions.