It is very much in the companies best interest to stop that kind of thing. If you go to them and they don't deal with the situation, they open themselves up to massive liability.
People forget that an employee is also a member of the company. What if the accuser is in management? Who is HR supposed to defend? By choosing to defend discrimination over the route that might actually resolve the situation, HR can end up causing more problems for the company in the end.
What do you mean "if"? That is what HR is for, defending the company. They do not exist for your benefit.