If you just talk player vs player I would rather have Williams than Hill. Even with Williams having a down year last year after a great year in 2020.
To their credit the Rams made a nice move to get a vet CB for cheap, but I'm not confident the secondary will be improved based on exchanging Hill for Williams.
To me, it's at best a lateral move.
Here's how the league viewed their values when they were both FA's within a year of each other-
Darious Williams signed a 3 year, $30,000,000 contract with the Jacksonville Jaguars, including a $1,500,000 signing bonus, $18,000,000 guaranteed.
Just last year Troy Hill signed a 2 year, $9,000,000 contract with the Cleveland Browns, including a $3,500,000 signing bonus, $4,500,000 guaranteed.