The men had been held on a remote island in a standoff for nearly six weeks after Filippino troops blockaded the island in a bid to close in on the kidnappers. The men were seized from their fishing boat in early December last year.
The captors, from Islamic militant group Abu Sayyaf, fled the southern island of Simusa Friday, bringing their hostages with them, said military spokesman Lieutenant-Colonel Gerry Besana.
One Indonesian fisherman, Heri Ardiansyah, was rescued as the militants tried to flee, but another -- Hariadin -- drowned in the escape bid.
Another hostage, Malaysian Jari Abdullah, was rescued by Filipino troops a day earlier and is now in a "stable" condition with gunshot wounds at a military hospital, Besana told AFP.
"The island had been blockaded for the past 41 days. They (kidnappers) probably thought they could slip past us by swimming," he added.
Three of at least seven kidnappers who were with the hostages were killed in the operations, he said.
The military got wind of the hostages' location in late February and ordered the small civilian population on the island to leave, Besana said.
Abu Sayyaf is a group of self-proclaimed Islamic militants based in the southern Philippines who have engaged in bombings as well as kidnappings of Western tourists and missionaries for ransom since the early 1990s.
In recent years the group has also preyed on cargo ships, tugboats and fishing vessels in poorly policed waters of the region near the sea borders with Malaysia and Indonesia.
Dutch birdwatcher Ewald Horn, abducted in 2012, a Vietnamese seaman and four Filipinos are believed to be still in Abu Sayyaf captivity, Besana said.