The result, at a plant owned by General Motors and a South Korean company, is a milestone for the auto union in organizing electric vehicle workers.
The automaker said the move would further its electric-vehicle goals. It may also defuse tensions with the U.A.W. ahead of contract talks next year.
The automaker and a supplier will spend $11.4 billion on three battery factories and a truck plant, creating 11,000 jobs.
The president wants half of the vehicles sold in the United States to be electric by 2030, hoping to phase out gasoline-powered engines that contribute to climate change.
The president wants to use pollution rules to rapidly lift sales, but there are hurdles ahead.
The president is hoping to make electric vehicles more affordable to turn a niche product into one with mass appeal.