The New York Court of Appeals, in a split decision on Tuesday, upheld a rule promulgated by the state Department of Agriculture that prevents some employees of the agency from running for elected office because of conflict-of-interest concerns.

On a 5-2 vote the majority—without issuing an opinion—affirmed a decision from the Appellate Division, Third Department last year that barred two dairy product inspectors employed by the state agency from seeking election to their county legislatures.