Surgery is generally considered a last resort for severe cases of sciatic nerve pain when other treatments have failed. It involves removing bone spurs or a portion of a herniated disc to alleviate pressure on the nerve.