That’s sure a tough one. Try a putty knife that has a real thin, sharp steel blade. Hyde makes a little 3″ red plastic cheapie that’s great for this sort of thing. Pick a spot where it appears to be stuck with paint and start working the knife in between the sash and the casing. Work your way around the sash, taking care not to damage the wood (I assume these are wood). Also, if these are double-hung, also work the knife between the sashes.
As you’re working the knife around, wiggle the sash to see if that helps loosen it up. It takes some patience to break ’em free and you’ll probably have to repaint them when you’re done.
You could also try putting a little heat on the sash with a hair dryer to soften the paint. Heat a small area and work the knife into it.
Good luck!