Do you have a lot of time to spend at Kamakura? Or is your time limited?
If your time is limited, than I’d recommend taking the JR line even though it’s a little more expensive as you’ll save about 1.5 hours on travel time. If you have plenty of time to spend and your starting point is on the Odakyu line, then that’s fine too. But as a tourist, I’d think you’d want to make the most of your time.