The five Indonesian men trapped in a tree for five days by Sumatran tigers have been rescued.