So, self-flagellation or lack of self-discipline? Or both? :-
Sorry for your friend, but this seems to be an unfortunately too common trait. Even in coach-led training groups, I have seen people race their workouts and leave their best racing in their workouts because the coach either cannot or will not rein them in any better than they can or would rein themselves in. Beyond my own observations, I have heard this from others, too. They will have people come up to them at the end of a repeat or workout and say something like, “your PR for X km is so much faster than mine, yet I was able to keep up with you!” Keeping up with (or “beating”) someone during one workout or during one day each week in training is not really the point, especially if one has not proven able to race anywhere close to that person. Additionally, some seem to have this archaic, oddball idea that just because it was hard that it was good or that it has to be too hard to be good.
It starts with being fully present mentally and keeping a focus on the exact purpose of the run or workout. If intending to do a workout with others, communicate. Say “this is what I am going to be doing tonight, repeats at this pace with this much recovery interval between.” If one is going to be out there hammering oneself then one might as well be doing it in a way to extract maximal performance benefit. It can still be hard and result in similar levels of fatigue and discomfort while at the same time being structured and thoughtfully applied in a way that relates most directly to preparing for the stresses of racing.
Your friend may or may not care to receive any direction. If he is determined towards self-destruction then you may just have to let him go do his thing while you maintain what you know will be in your own best interests.