Loser is almost always a person. For example, the person who doesn't win the game, match, contest, etc. is the loser. You can't use failure in this sense.
A loser can also be slang for a person who is completely unsuccessful in his/her life. It's an insult to say someone is a loser in that sense.
A failure can be a person who is not successful in his/her attempt in a general sense. "He was a failure in the business world." Failure can also be a thing as "a failure to communicate", "a failure of a machine part", or "brake failure". In that sense, it means something didn't work as it was supposed to.