I'm thinking that that first cow might try to avoid you, but those behind it may not see you in time. Standing still might not be the safest thing to do.
If I can't get to cover- or more accurately, off the ground in a tree- I'd say making myself as visible as possible would be the best option. I'm guessing they typically don't run into the tree because they can see it- several cows back, its visible. So I'd start making myself look as tall as possible by jumping up & down and waving my arms.
Hence why I wouldn't want to test "standing still", but the principle, of making yourself obvious like a tree or pillar of flame would cause the animals to go around you by nature of their object avoidance code in their brain.
Here's what I know from reports on observing deer. Each one has a reaction pattern to a sudden threat. They jump/twitch to the right or left and take off running. The direction/pattern is constant per deer. Some are left jumpers, others are right jumpers.
When a herd stampedes, it's the same thing, except herd mentality kicks in so they all move to follow the "acting" cow. So in the beginning, it's one or two cows on the perimeter, reacting to a threat (lion attack), and those cows twitch, and take off running. The cows nearby see that reaction, and copy the movement, which is to "go that way in a hurry". This cascades through the herd until they are all running in the same direction, because nobody wants to be left behind (that's the one the lion catches).
Next up to consider is herd size. How many cows/antelope/whatever are in this herd of "natural, but interesting size"? I would bet 20-50 head, without looking anything up. If it was a cattle drive getting spooked, maybe 1000 head. You can fit 3 cows in the space of a non-small car with some room to swish tails, if that gives a sense of how big a more tightly grouped cluster of cows would be. In grazing pattern, they'd be spread out pretty good. Under a threat, they start tightening up ranks.
So I've covered the "lack of risk" of getting hit by a stampede. Let's look at what happens when one happens anyway because the players were unlucky.
Moving perpendicular to their path IS an option if they are far enough away and the party can move.
Being an obvious obstacle (tall enough to be seen by most of the herd, not just the front cows will get you avoided. Give choice of open field or cluster of trees, the stampede whill head for the open field as they ALWAYS move toward open spaces, not confining spaces.
If the party has setup camp with reasonably big tents, the cattle will probably not run straight through the camp as you will appear to be an obstacle.
if the party is just sleeping on the ground, not so obvious, the cows are likely to not notice you initially, and thus set their course for you (as likely as any other "open" direction on the compass"
Once the herd is close, killing a few big cows and making a cow wall may work, as now the cows have an obvious obstacle to avoid as subsequent ones will approach it. There's a chance one of them won't be paying attention as he tailgates another and he will have to try to jump over the wall. This might be painful.
The elf in the party will no doubt try jumping up and running on the backs of the cows like a leathery treadmill. That's probably a jump check to get up there, and a jump check every 5' of "herd" to run through to keep hopping cows.
The caster will try some flame strike or ball of fire trick to make an obvious an ominous barrier to the herd. it will actually work pretty well, as the herd will avoid that and trample the party that isn't behind the fiery obstacle.