New York lawmakers approved a bill to expand labor protections for farmworkers, including the right to organize, collect overtime pay, and take 24 consecutive hours of rest every seven days.

The bill (A8419/S6578), a compromise version forged by Gov. Andrew M. Cuomo (D) with bill sponsors and farmer groups, passed the state Senate 40-22 in the late evening June 19, as legislators worked to meet a scheduled adjournment date. The state Assembly had approved it earlier in the day by 84-51.

Cuomo, in a statement, said the compromise bill “guarantees farmworkers will finally be granted basic rights to...