Building trades unions — long fashioned as the voice of the American worker — are now intertwined with the richest companies in the world as they create America’s artificial intelligence economy.