Disclaimer: I have very limited experience, so what follows may not accurately reflect professional conventions. That said, from my limited experience I think it does.
EDIT: Disclaimer the second: the answer below assumes that you are correct, and also says nothing about what you should do besides what to write in the paper. Noah Snyder's comment below is absolutely correct.
I think this is something that you need to do, to provide an accurate history. This doesn't have to be done "loudly" - I think a footnote would be fine (e.g. "A weaker version of this result was claimed in [people], but the proof given there is incorrect - they [thing that they do]") - but I think it's important that an accurate history of the result be presented.
In my opinion, this is true whether or not you knew of their work before starting/finishing your own; we all benefit from a clear discussion of the literature (and in particular this may do a service to others who read the 2009 article and don't notice the error at first).
This is assuming that the article in question is "serious" - as we all know, there are of course "articles" which are too wrong for the above to apply. I think my criterion would be: "Is this article something which a 'reasonable' mathematician, competent but not necessarily expert in the specific subfield, might take as generally correct?" Obviously this is subjective, but I think in most cases it's actually pretty clear which side of the divide a given article lies.