They work for Cognizant. All their benefits/pay/whatever is paid by Cognizant. AT&T is only responsible for whatever is stated in the contract.
Long ago I worked for a big contracting company and was one of a group of engineers contracted to work at AT&T. Our AT&T supervisor was great and treated us well -- but he did make the point that "you're basically an expensive piece of office furniture" on his budget. The contract did allow for him to reward us financially -- but it was indirect. He'd write up something and submit it to our contracting firm which then would pay us/whatever. I greatly enjoyed working on that contract!
Even if we'd unionized (ha!) it wouldn't have had ANY affect on AT&T. Everything was in the contract and so our unionization could ONLY affect how our contracting company treated us. If it meant AT&T paying more that would probably have just exercised some clause in the contract and it would have been terminated.