In Sarah's case, "Duchess of York" was essentially her surname, and after the divorce that is all it was: no longer a title, just a surname. So it followed - as is the case with most women who have taken their husband's surname on marriage and keep using it after divorce - her post-divorce name was her first name followed by the (former) husband's surname. Thus Sarah went from being HRH, The Duchess of York, to Sarah, Duchess of York. She lost the royal style of HRH automatically when she lost the royal husband because she only had it as of courtesy as his wife and to keep using it would have required the monarch's consent.
I don't think she lost the HRH style automatically. The Queen actually had to issue Letters Patent in 1996 to clarify that former wives of British princes were not entitled to the HRH.
https://www.thegazette.co.uk/London/issue/54510/page/11603