The alleged members of the al Qaida-linked Jemaah Islamiyah network left a handwritten note close to the bodies, vowing more killings to avenge the deaths of Muslims in earlier sectarian violence on Sulawesi island.
"Wanted — 100 more heads," said Judge Lilik Mulyadi, reciting the letter's text. "Blood must be paid with blood, lives with lives, heads with heads."
Hasanuddin, 34, who goes by a single name, was sentenced to 20 years for masterminding the 2005 attack, and co-conspirators Lilik Purnomo, 28, and Irwanto Irano, 29, each got 14 years, he said.
Indonesia, the world's most populous Muslim nation, has been hit by a string of terrorist attacks in recent years targeting local Christians and nightclubs, restaurants and foreign embassies.
But the grisly nature of the beheadings, which occurred as the children were cutting through a cocoa plantation on their way to school, gave fresh impetus to the country's war on terrorism and was followed by scores of arrests.
The three militants had faced a maximum penalty of death by firing squad, but judges ruled that they deserved some leniency for cooperating with authorities, confessing and showing remorse.