I would say "stay up the tree" is correct. I think it is actually quite difficult to stay ON a tree. I understand ON is similar to "on top of", so you can stand on a table or on a chair, but not on a tree. But, could you stay IN a tree once you have climbed up the tree? Usage of prepositions is so very complicated!!