Sounds like you are replacing an old rubber hose, good deal. I known people who had interior deterioration and find them selves locked in place since a "check valve" had been formed by the rubber. I'd also consider dong the front rubber hoses if they are also 15 years old.
It sounds like you got the rust problem, after 15 years it to be expected. I take it the hard lines on the rear axle backed out of the metal fitting of the rubber hose without a problem. You just need to replace the rear brake hard line from the rubber hose forward.
I think you may be in luck, bascially every XJ with the 4.0 is the 87 XJ 4.0 with minor alterations. I found out in the past year to two when my adjuster broke on the same shift cable that the same shift cable was used on all AW4 transmissions. The part was still available.
I am thinking it may be the same situation for your hard brake line you cut off. I'd call your dealer and talk to the parts guys and ask him. I know which parts guys at my dealership know their stuff, hope you are on the same terms with your guys.
I'd say Jeep still has hard line in the system. My dealer stocks lots of parts but if they do not stock this parts they should have it to you tomorrow or the next day depending on the warehouse it comes out of. I'd also say it will be priced competively with the after market part you are considering AND it will fit without modification. For parts like this you can't beat dealer parts for fit even if the aftermarket guys try to get it right there is alway something they over look, it happens when you "reverse engineer" tubes. I'll even pay more for a dealer just to avoid hassle when it comes to fit.
Give your Jeep dealer a call, and use a dealer that sold XJs in 1990, the parts guys will understand any "differences" between the AMC design and the post 90 Chrysler design. If you go to one of these dealers that picked up Jeep in the mid 90s the parts guys will look at you like you have two heads when you ask for a 1990 XJ part. I learned that lesson when I lived in St Louis. I ended up using two dealers who were AMC Jeep dealers and sold Jeeps since the 1950s, hard to find those dealerships any more but they are out there.
Good luck, you will find it, the parts are out there!