What to do if one has had an unsuccessful PhD (because of others' fault)? I was talking to a friend of mine, and he just feel in a deep depression due to finishing his PhD.

He will be defending in the coming weeks, and there is a high likelihood he will pass. 

In his words, he doesn't really feel he has learned anything PhD worthy, he only has one Journal paper and no conference papers (in his area conf papers are not worth much anyway). According to him, one of the postdocs kept his research at bay by denying him access to the machines he need to do experiments (something CMOS related, not really sure what). And in his own words, the same guy basically did the same experiments he was planning and wrote a couple of papers. 

Of course he tried to tell his professor, but apparently he couldn't care less. 

By now, he just feels that he lost 3 years of his life doing a PhD. And he mentioned that he might sue the Professor/University for this.

I take his word for all of this, and I have no real means to corroborate it to be truth. But it kept me thinking about one thing.

Is a student entitled to sue/demand a reimbursement/etc if he/she feels like the past years have been an utter waste of time?

Is there any mechanism in your universities to do this?

I've heard of similar cases of professors abusing of students in the same way in some US Universities (big/fancy ones by the way)
There sure are cases, every now and then, of researchers (professors or other) abusing students in various ways. As everyone, I have heard stories, and I know at least a couple of people who have been put in dramatic situations during their PhD. However bad the behavior of the advisor is, it turns out that there are multiple venues one can try, during the PhD, when the alarm flag is raised. These depend on the institution and type of employment, but they include:


Going to see the PhD program director, explaining your situation (diplomatically) and asking for advice (read: help).
Finding a friendly researcher/professor in your department, and ask him for advice (and possibly help) with your issue. They know the people and local “politics”, and might have efficient advice.
Your employer's HR department
Going to your professor's hierarchy (department chair, dean, …). As a last recourse, file a formal complaint.
Get someone to speak for you: a union representative, a member of the local “PhD association”, etc. That can help if you are worried about the fallout of intervening directly.
Changing your plans to work on a more “independent” research. In your example, your friend was denied access to a given experiment. If the experiment had broken down beyond repair, he sure could reörient his research, so the same thing could be done in the case at hand (I'm not saying it's easy).
Walking out (or, as JeffE would surely say: don't walk, run!)


Regarding legal action: I don't think this avenue can lead anywhere, unless there is factual evidence of gross misconduct or unethical activity. The burden of proof relies on your friend, and I think it will actually be harder to complain after the fact if he did not raise his concerns formally during his PhD.