How to render object in front of everything else?
Create two scenes, one with the tree only and the other with the robot only.

The robot scene should have a transparent background (Select Film Transparent in the Rendering Properties menu).

In the Compositor mix the two scenes using the alpha of the robot scene as mix factor.