You do need to undo the brake lines.
You need to use a line spanner which is like a ring spanner, but with a notch cut out of it. These grab onto the nut much better than a normal spanner and hence don't round the nut off.
If the nuts are too far gone to use a line spanner on then you'll have to use multi-grips or vise grips to undo the nuts, but this should be your absolute last resort.