Apple Inc. convinced a federal judge to dismiss a proposed class action alleging the technology company duped buyers into believing certain Apple Watches they purchased were “carbon neutral.”