Strip caulk, or butyl caulk. I believe they did it to insulate it from vibration and try and keep airflow going through the core and not around it; but they needed a material that was resistant to moisture(condensation) and wouldn't dry up.
Butyl caulk.
If the relays work but you have money burning a hole in your pocket--or you absolutely hate doing work on your truck--then I guess you can replace them just for the heck of it. But otherwise use them till they break, I guess. Your call.
EDIT: Caulk:
https://www.amazon.com/3M-08578-Blac...a-496944296532
I have this and other versions of it and let me be clear: While I don't think it's useless, it's a gawddam mess and I have found it a little tricky and gooey to work with. Have fun.