Do the rental companies require you to take a 4 wd to St John?

It is not a requirement that you have a 4WD vehicle when going to St. John. However, in few areas 4WD comes in handy. Just yesterday someone got stuck on a curb and had to be pulled off. Had they had 4WD they could have simply driven away.
Ed has a good point about location.
A few of the St Thomas rental agencies DO require that you rent a 4WD vehicle drive if your vacation destination is St John. Many (if not most) of the rental villas are located high up in the hills on steep and sometimes rough roads which require the added traction of 4WD for safe maneuvering. The rental agencies on St John ONLY carry 4WD vehicles.
Do you need a 4Wd to get to Trunk Bay?
No. On a day trip from St Thomas to St John you'll be able to get around the island just fine in a compact/2WD.