How to remove window with minimum damage to outside trim
There are replacement window inserts from most major window manufacturers. If your existing window frames are sound, you remove the stops (the vertical strips that hold the sashes in) and the upper and lower sashes. The new window includes a very thin frame with sashes preinserted that attaches and seals to the existing frame. This is done without removing or replacing inside and outside casings (face moldings).

Search replacement window inserts for information from the manufacturers.