Unfortunately, the countershaft itself will have to be replaced. I don't see a way around this. Sandblaster might have a replacement available for you.
Who/what is Sandblaster? Am I correct in assuming the countershaft is NLA?
How does the rest of the bike look? Hopefully, this is the worst mechanical issue you'll encounter and not the "tip of the iceberg."
The rest of the bike is in bad condition, but I couldn't spot any frame cracks. The engine looks terrible, so it would be the first thing I tear down. I suspect one of the cases has a crack in the bottom, but haven't had time to confirm yet.
If memory serves, 1989 was a very good year for the KX 125.
The 89 was bike of the year for MXA and Dirt Bike if I remember. It was hands down the best of the 125s that year. The 46mm conventional forks were some of the best to come on that era of mx bikes. I previously owned a '85 and '86 KX125 and loved both dearly. They were my first full size mx bikes! So there is some nostalgia tied up in this purchase.
If I can source some new parts for the engine (countershaft and who knows what else when I get inside), I may do a full resto. Piston, crank, bearings, ect -- not worried about those since they are relatively easy to come by. The radiator is garbage, and the carb looks like it was "worked on" with vice grips. The rest of the bike isn't a pretty sight, but here's what I did with a 87 RM250 a few years ago
before
after