Open the bleed port on the caliper and push mineral oil through it using a syringe and tubing, keeping the funnel in place to catch the excess. Make sure there are no local minima in the brakeline where air can get trapped, and make sure the levers are well above the caliper height when you are working on it. Squeezing the lever can dislodge air bubbles, but I think Shimano actually recommends doing this, as it can suck air in as well.
If the rear brake leaked, air had to get in to displace the volume of mineral oil that leaked out. It is trapped in there, somewhere.
I presume also you have fixed the source of the leak? If not, you can't pressurize the system, since it needs to be closed.