If your goal is to prevent deaths, surrendering would have been the ideal yeah.
This has literally never been true in any war ever. Foreign occupations rarely tend to be bloodless and I doubt a Russian one would have been an exception. At no point were any of the peace talks about Ukraine’s surrender – only renouncing it’s NATO ambitions in exchange for the withdrawal of Russian troops, as per:
“In the weeks ahead of Johnson’s April 9 visit, high-level diplomatic talks held in Belarus and Turkey had failed to yield a diplomatic breakthrough, though reports in mid-March indicated that Russian and Ukrainian delegations “made significant progress” toward a 15-point peace deal that would involve Ukraine renouncing its NATO ambitions in exchange for the withdrawal of Moscow’s troops.”
At no point was surrender on the table - that would have likely lead to Zelenksy’s detention and execution in the early days of the invasion.