You are quite right that a private conversation would be the best path to follow. Because someone does something wrong in public doesn't mean they should necessarily be rebuked in public. StackExchange itself offers no way of initiating a private conversation. Even creating a restricted-access chat room allows anyone to view what you have said.
I think your overriding concern must be how constructive your response is. This is one of whose areas where knowing the halacha is not as useful as a profound understanding of human nature. You need a great deal of empathy to accurately understand the subjects's motivations. Why did he say that? Where is he coming from? And most relevant, how would he react to what you have to say?
My understanding of rebuke is that the mitzvah simply doesn't apply if it will not be accepted. Secondly, there are as many ways to improve a person as there are ways of human interaction. I remember a shiur from Rabbi Benji Levin who turned around someone else's behaviour in such a genius, gentle way that they realised their error themselves. It's not just a case of saying to someone that they are wrong.
When it comes to Lashon Hara we are not allowed to spread someone's disgrace further, and a public forum like this would make it far worse. Still, it may be a consideration that his comment is publicly visible already, so you are not exactly making know something that was hidden. Also is what he said really a disgrace? This depends on too many factors to make fixed rules about.
To my mind, I think it would be permitted to simply point out that you disagree with what he said, and why. He has entered a public debate, and if you can be reasonably sure you will not make things worse by engaging with him, you are welcome to respond. You need to be dispassionate in your arguments, open to listening and engaging with his response, sympathetic to his point of view (without necessarily agreeing to it) and very respectful of him as a person. Asking questions about flaws in his arguments, as if you just want to understand his point of view, is far more palatable than pointing them out directly and bluntly. If at any point you see that continuing will make things worse, apologise and back off.
Let his faults be his problems, and let your upset about his comments be yours. By this I mean don't expect to be able to change his mind, and don't expect him to feel sorry about upsetting you.
Reasonable and respectful debate, even in public, does not have to transgress Lashon Hara.