I have no idea if they are required to do so, but it's worth noting that while the government requires a warrant to open US mail and inspect the contents, your agreement with UPS/FedEx allows them to open anything they see fit to.
To be clear, it allows UPS/FedEx to open it, not the government. Although UPS/FedEx can then voluntarily give it to the government should they open it...
I'm sure they record your data for other reasons, like checking to see where lost packages were actually delivered, optimizing delivery routes, etc. But yes, the government probably can request their data on you too.