Surrendering when the Army of the Potomac crossed the James would have been premature. In order to win, the Union needed Lincoln to win reelection. For that to happen, the US Army had to show persuasive evidence that it was going to put down the rebellion. Even if Petersburg meant an ignorable end, the CSA could still win if they looked viable enough to discourage the northern electorate.
On top of that, Lee had one more military option. He formed a mobile striking force under Jubal Early. He turned Early loose on the valley. Early doing a good Stonewall impersonation rampaged through a series of inferior Union commanders. It even looked briefly as if it would work, but then Grant put a large force under Sheridan and Early's force was virtually annihilated in a series of battles.
Now the CSA would have been better served by getting the best terms they could in late 1864 when they still had credible bargaining power. But that was Jeff Davis's decision to make and not Lee's. By that time, poor old Jeff had slipped into an alternate reality where the CSA would ultimately prevail so a negotiated end was not going to happen.
As an aside, I doubt that Jeff had the power to terminate the CSA on his own, I do not think that the CSA congress would have gone along. It was dominated by southern aristocracy. The Southern aristocracy was probably far less likely to face facts than Jeff Davis.