Were defeated British officers able to return home after England lost the war or were they taken prisoner? I am writing a novel set in the aftermath of the American Revolution. What happened to the British officers still in the colonies after the war?
Perhaps you should ask about the prisoner of war conventions in European society in the 1780s.
If the prisoners survived being imprisoned, the probability of which would vary greatly, they would normally be released following the the formal ending of the war with a peace treaty.
Furthermore, prisoners could be released under parole, promising to refrain from fighting until they were formally exchanged for other prisoners. Prisoner parole and exchange was practiced in the US Civil War until it broke down later in the war.
The peace treaty might contain clauses about when and where prisoners would be released from custody and/or returned to their home country.
In any case, the a country with prisoners of war would have little motive to keep them prisoners of war and pay for their upkeep and guarding them once the war was over and any legal right the prisoners of war had to fight that country were ended. And certainly retaining prisoners of war after the war was over would antagonize the former enemy and risk a new war.
The question also assumes that the entire British armed forces in the USA were captured during the war. That was not true. In fact a large British army remained free in New York City and other regions after the last big campaigns of the war and did not leave until the peace treaty was signed, after which the British government provided ships to transport them to Britain and wherever else they were now assigned to.
Article Seven of the Treaty of Paris in 1783 states:
There shall be a firm and perpetual peace between his Brittanic Majesty and the said states, and between the subjects of the one and the citizens of the other, wherefore all hostilities both by sea and land shall from henceforth cease. All prisoners on both sides shall be set at liberty, and his Brittanic Majesty shall with all convenient speed, and without causing any destruction, or carrying away any Negroes or other property of the American inhabitants, withdraw all his armies, garrisons, and fleets from the said United States, and from every post, place, and harbor within the same; leaving in all fortifications, the American artilery that may be therein; and shall also order and cause all archives, records, deeds, and papers belonging to any of the said states, or their citizens, which in the course of the war may have fallen into the hands of his officers, to be forthwith restored and delivered to the proper states and persons to whom they belong.
Were defeated British officers able to return home after England [sic] lost the war
Just as defeated American officers were able to return home after they lost a battle, officers of both sides were often repatriated during the conflict.
This was the norm for many nations in the centuries around that period. As can be seen from a couple of examples from later decades -
For example William Sitgreaves Cox defeated and captured near Boston:
While he was below the ship was boarded; though he returned and attempted to defend the vessel, he was taken prisoner. After being exchanged he was promoted to third lieutenant".
His ship USS Chesapeake was renamed HMS Chesapeake.
Or Stephen Decatur defeated and captured near New York:
The senior naval officer at the prison took the earliest opportunity to parole Decatur to New London, and on February 8, with news of the cessation of hostilities, Decatur traveled aboard HMS Narcissus (32), landing in New London on February 21
His ship USS President was renamed HMS President.
The distinction between parole and exchange is that an exchanged officer could fight again, a paroled officer could not again fight in a conflict with the same nation that had defeated and captured him.
P.S. England and Britain are not the same thing.