The president toured the rainforest and promised Brazil funds for environmental initiatives, even as the incoming Trump administration appears poised to roll them back.