Noel Choong, head of the International Maritime Bureau's piracy reporting center in Kuala Lumpur, said the value of the ransom has not been disclosed, and he declined to identify who paid it.
Gun-toting pirates attacked a Malaysian barge on Aug. 13 and abducted the vessel's Indonesian ship master and chief engineer. The pirates did not steal the barge, or any of the steel billets it was carrying from Malaysia's northern state of Penang to Belawan in Indonesia.
It was the third pirate attack in the Malacca Strait this year, but the first kidnapping in the busy waterway since July 2005.
Choong said the pirates freed the Indonesians early Friday. No details about the pirates were immediately available.
"We hope the Indonesian authorities will take swift action to detain the culprits to show they are serious in dealing with this problem," Choong said.
He also urged Indonesia to increase patrols in its waters to ensure that kidnappings would not become widespread again.
The strait is notorious for robberies and hijackings but the number of attacks has fallen since Malaysia, Indonesia and Singapore, which share the waterway, launched coordinated maritime and air patrols in recent years to curb piracy.
Some 65,000 vessels pass through the Malacca Strait each year, carrying half the world's oil and more than a third of its commerce.