An Indigenous community in the Peruvian Amazon is celebrating a legal victory in the latest stage of its attempt to take back claimed ancestral rainforests.