There its a misunderstanding of the legal semantics here.
A state of war, does not always mean that there is kinetic military conflict taking place. Military engagements are a part of war, not the sole condition for it.
An unconditional surrender document only ceases military hostilities, it does not terminate a formal declaration of war.
After a military surrender, the victor becomes an occupying power subject to the same conventions that applied during armed conflict and under the original declaration of war.
During WWII, Japan signed the Instrument of Surrender aboard USS Missouri on September 2, 1945, however, the US declaration of war against Japan did not end until September 8, 1951 when the Treaty of San Francisco was signed by Japan and all 47 Allied nations.
Same happened in Europe with Germany. Technically the state of war declared by WWII did not end until 1990 when the the four occupying powers and the two partitioned German states signed the 4 2 agreement which reunified Germany and returned full sovereignty.