Rangers (38-41) likely not making the Postseason, though deGrom has a full no trade clause. They probably would love to unload the remaining years and money left on his contract if they could.
As for the Cardinals (43-36), they weren't expected to be competing this season, but here we are. If they keep this up after the All-Star Break, they likely will be buyers. If the Cardinals wanted to retool for next season, Gray could bring in some nice pieces if he waived his no-trade clause. There have been rumours before about the Cardinals wanting to trade Gray, and even Gray being unhappy about the Cardinals rebuild after he signed that 3 year/$75M deal.