Congress has the power to declare war and the president signs the declaration (or vetos) as well. Who has the power to surrender in a war? Would congress have to vote to surrender?
"Surrender" is not a power that is explicit in the constitution. A complete surrender, such as occurred at the end of the second world war in Germany would imply the constitution ceasing to function. The de-facto constitution would be "military occupation" followed by a new constitution written by the victors.
However surrender can also mean "armistice and treaty" The President can order an armistice and negotiate a treaty subject to approval by the Senate.
Surrender can also mean military withdrawal, such as at the end of the Vietnam war. A President can do this unilaterally
The question assumes that "surrender" is a stable and organised process. Instead, defeat in war is normally chaotic, precipitous, unplanned and extraconstitutional. Surrender often implies giving substantial constitutional powers or land to the victors. This is not permitted in the constitution, but that doesn't mean that it can't happen. The constitution describes how the country is run in normal or predictable times. It doesn't describe its own overthrow.