Dremel++ When I took the engine out of my car the same two nuts were an arse to get to, I couldn't whack a socket over them because of the pipe itself, so I just stuck the little thin cutting wheel on my dremel and chopped the nut, took about 2mins for each one...I love my dremel!
Then I had to pop down to Halfords to buy a stud extractor to remove the old studs, remember, when putting new ones in, lots of copper slip!