The reason we see so many stories of lawsuits is that there are in fact a lot of lawsuits. One of the problems is you can sue for anything and the way the legal system works there is a reluctance to throw out crap cases and fine the lawyers bringing them (it doesn't help that with lawyers, there is often a lot more supply then demand). When I was getting my masters in management the business law classes had a lot with liability and how it works, and the problem is that it isn't always so clear. Having been on civil juries I can tell you it isn't easy, because at least in NJ it looks like there are no guidelines, juries are expected to come up with a verdict and amount basically on their own. I had what was basically a whiplash case (one old lady rear ended another one, it was a really low speed impact, take it from me), and the person suing was suing for like a million bucks for injuries and the like. One of the injuries was agreed to by both lawyers from the accident, the other one we felt was not caused by this incident. Based on that we had to come up with a number....we had a good jury that was rational, and came up with what I think was a fair judgement (it was prob like 1.5% of what they asked for).
The thing is, with a lot of these cases, the company settles because it would be more expensive to litigate it, lawyers don't come cheap when you are a defense lawyer (on the other hand, plaintiffs lawyers often operate on fee contingency, they collect if you win).
The other thing is when these go to trial what you don't see is what happens down the road. Huge jury verdicts make big headlines, but often trial judges and then appellate judges reduce the verdicts significantly because they realize juries often operate out of emotion or frankly not knowing (why legislatures don't give guidelines, well, I leave that one to others, that is political, don't want to go there). The husband of a woman I was friends with was a state supreme court judge in the Bronx (this was late 80's) and handled lawsuits against NYC. Bronx Juries are often synonymous with huge awards, and from her I know that most of those end up a fraction of what they got from the jury, and in more than a few cases the judge sets aside the verdict and award on the grounds it wasn't backed by the facts in the case (I don't know the process after that, I assume it goes to appeal).
In terms of suing a company, the standard is supposed to be 'reasonable man' status (and I know there are lawyers on here, and they likely have much better knowledge than I, this comes again from my management training). Obviously a railroad cannot protect everything and no trespassing signs and enforcing that when they find violators would (in my opinion) be considered enough under reasonable man standards. On the other hand, if the railroad had something that was shown to be dangerous and an 'attractive nuisance', like let's say an abandoned turntable that teenagers were hanging out at or whatnot, and they didn't for example make an attempt to put a fence around it to keep them out, kids got hurt, they still didn't do anything, they could be held liable for not taking 'reasonable precautions'.
I did see a lot of cases that made me scratch my head (like a lawsuit against Toyota where a woman had imbibed a bottle of jack daniels, was driving with a BAC of like 1.5, went off the road, was thrown from the truck [not wearing seatbelts], was severely injured, and sued toyota , despite the fact that the truck had no recalls against it, met all standards, etc..and was given a huge settlement, judge upheld the award. Appeals court threw it out entirely, ruled that the jury and the judge totally misread the law and acted out of emotion, not the law).