Before you spend money, you may want to get a second opinion.
Window replacement is a major project. Check the reports and disclosures. See if it was disclosed in any of the documents. Have you talked to your agent? Sorry I can't give you legal advice.
I wish I could help.
Who said the windows need to be replaced and what was the response of the inspector when you told him/her this information? An inspector is looking for open/close, lock-able, seals (if double paned), and cracks in glass. If something was missed, talk to the inspector about it. It would seem odd that all of them are not working? Or is it that someone recommended an upgrade?