It should be said that, a sauropod's greatest defense is its size. This is true for large herbivores in every environment: merely being huge confers a great deal of advantage over the environment. Predators tend not to be very large in relation to the largest "prey species" in their environment, the contrast between humpback whales and orcas, for instance, is an order of magnitude (40t and 15m vs 6t and 8m, which means at double their length, humpbacks are greater than four times as massive). Elephants and lions (or tigers, considering). The main contradiction here would be sperm whales, which focus on smaller prey and are the largest carnivores in the ocean, but do not predate on other whales (generally). Sharks are similar; like all other predators, they tend to favor prey species *smaller* than themselves.
This sort of predator/prey sorting is by necessity. An elephant can kick. A hippo has a vicious bite. Rhinos are very strong, and that horn is a deterrent. Simply being huge may not be an absolute defense, but there are quite often much less troublesome, namely smaller, prey to be had. Juveniles, for instance, or the sick, infirm. They will tend to be "left behind" their social groups, or cannot be protected absolutely, when predators "raid" such groups seeking to peel parent from child.
But when it comes to defense, you'll notice that armored or spiked "prey" tend to be smaller than the largest herbivores in their environment, which puts them closer to "a good meal" range and not "waste your weeks' energy budget trying to kill with cooperation," which is how Savuti lions take down large prey. The cost has to be worth it for them to even try.
But to the specific question, I did mention elephants can kick? A leg capable of supporting at any one time one quarter to one third of an animal's entire body mass in the 20+ ton range is going to have a phenomenal amount of power behind it. This was the point of Taylor, Wedel, and Cifelli naming Brontomerus "thunder thighs," opining that (tongue in cheek) a massive femoral retractor would confer a massive rearward swing of the hind leg. Now, we can quibble about the necessity of such a thigh for the sake of merely kicking, and not being the natural capability of an animal elevating its entire body weight on just the hindlimbs, but it stands that, the ability to support 20+ tons means each of your legs will hit like a truck. For an animal in motion, momentum adds to this and any claws at the end of the leg will become extremely dangerous, even if they're not "razor sharp" (which, let's be honest, they're used for digging, they're not going to be sabers but spades).
So the answer to your question would be: alright, maybe. But they wouldn't need to. And as Heinrich said, and a few papers have suggested, the maths on tail movement itself is as much a matter of "really large thing imparting momentum and force to smaller thing" and the natural consequences of smaller things not having the resilience to withstand such forces. Big tail hits smaller animal = pain. The tailtip doesn't need to be a whip when the middle of the tail is just as dangerous, if not more so.
Cheers,