Try tightening first
I have shut off leaks under the toerail for 14 years by tightening the bolts that hold the toerail down.
Then, I ran a bead of 5200 down the inside edge of the toerail where it meets the deck. These two have made us drip free for yhe past 5 years. That's a good thing, because re bedding the toerail is a bear!
If you have to rebed it, I think butyl tape (Mainesail's suggestion) is the right material. The hull/deck joint needs a sealant with some give, and 5200 does not have much give!