Drivers in Massachusetts for ride-hailing apps such as Uber and Lyft have become the first in the nation to certify a union.