Is the lemon tree in a pot or in the ground? Did the soil get too dry (or hot if its in a pot)?
If the branches are still green, the leaves will regrow. But a tree with no leaves will go into survival mode. That means producing seed will take precidence over leaf production and survival.
I would pick off the fruit and try to save the tree.