cpvc vs pex for lines run outside

I got a slab leak under my terrazzo floor. We’re going to have the house repiped. My attic is tiny and I don’t want my ac duct work getting messed up. We were gonna have the plumbers go around the house in a trench rather then thru the attic. some plumbers want to use cpvc and others pex pipe. Which is better? Is it ok to use pex pipe underground in a trench? TIA