Tens of thousands of patients were waiting for routine treatment at South Tees Hospitals Trust in October, figures show.