How do I fix a loose brick on the corner of a tree well?
You could get rid of the mortar debris using a chisel or a good flat-bed screwdriver and a hammer. Just put the point of your chisel on the debris and hit on top of the chisel with your hammer (be careful of your chisel holding hand).  

Note: you should put your brick on a hard surface or else you'd break your brick as well!  

After being all done with the cleaning, mix your mortar with some water so that your mortar looks jellyish and apply mortar using your trowel following the same pattern like other bricks.

Oh, and the reason for it coming loose, maybe a shock, or temperature variations, rain/snow -> freezing -> unfreezing 

Hope this helps :)