King Goujian's army was known for scaring its enemies before battle by forcing its front line, composed of criminals sentenced to death, to commit suicide by decapitating themselves.
Unfortunately, Wikipedia did a poor job in translating Shiji. As pointed out by the OP and Wikipedia, the exact corresponding sentence in Chinese (second sentence of second paragraph in Chapter 41, Shiji - see image below) is:
越王句践使死士挑战,三行,至吴陈,呼而自刭。
There are two inaccuracies in the translation. "死士" means soldiers willing to die (for Goujian), instead of "criminals sentenced to death". "自刭" literally means to commit suicide by cutting one's throat, which is a fairly common way to end one's own life in Ancient China. (The most famous man who slit his own throat is Xiang Yu) "cutting your own head off" or "decapitating themselves" is at best not accurate.
To be fair, Sima Qian, possibly the most famous historian in the history of China, sometimes stretches the truth to make the story more dramatic. But personally, I'm more inclined to believe his account:
- Goujian's strategy can be rationalized by the game of chicken. It could be rational to make your opponent believe that you're irrational (making your men kill themselves).
- People's view towards death in Chunqiu period is very different from today's mainstream view. Those soldiers willing to die (for Goujian) may have believed that their sacrifices can be compensated in life after death. In fact, some stories in approximately the same period suggest belief in life after death was quite popular, e.g. Wu zixu whipping the Dead body of King Ping of Chu and the phrase “Never see each other again before seeing the yellow fountain [the equivalent of River Styx]”, which is about a seemingly sad story of a mother and a son.
Further examination reveals that the problem may lie in the choice of reference rather than the cited claim. Another source, Zuozhuan(左传) (Chapter 51, the second sentence of the third paragraph), is supportive to claim that At least some criminals sentenced to death are involved in that battle
勾践患吴之整也。使死士,再禽焉。不动。使罪人三行,属剑于颈。而辞曰:‘二君有治,臣奸旗鼓。不敏于君子行前,不敢逃刑,敢归死。’遂自刭也。师属之目,越子因而伐之,大败之。灵姑浮以戈击阖庐,阖庐伤将指,取其一屦。还,卒于陉,去檇李七里。
"使罪人三行", assigning criminals into three rows, explicitly shows that some criminals cut their throats in the faces of army of Wu. But I'm not sure whether "死士",soldiers willing to die and those criminals are the same person. It's possible they have different jobs. One is to commit suicide conspicuously and another is to implement the surprise attack. There is yet another possibility that the suicide is a trick, as shown in the TV episode(see the bottom).
Here are screenshots of the beginning of second paragraph of Chapter 41 of Shiji and the third paragraph of Chapter 51 of Zuozhuan(They actually depicts the same event that marked the death of Helv(阖闾), the king of Wu).

My translation:
Goujian, the King of Yue, assigned warriors who were willing to die for him to launch a surprise attack on their enemy, the army of kingdom of Wu. Those soldiers lined up into three rows. When they rushed into the front of army of kingdom Wu, these men cut their throats, roaring.
A depiction of this event in a Chinese TV series, States of Eastern Zhou Dynasty:
Wiping out of Wu by Goujian.(from 2'30'' to 4' 30'')
Caution: As pointed out by a youku user 雪拥蓝关马不前, a glaring error is that it's Ling Gufu(灵姑浮),rather than Goujian who maimed Helv in that battle.
种伤阖闾的不是勾践而是勾践的大将灵姑浮
Thus, it's highly possible, the primary goal of that TV series is not historical accuracy, which means I'm doubtful about the depiction that these criminals don't actually kill themselves.