The prosecution said the court refused anticipatory bail to Dr. Ram after finding prima facie merit in the allegations, including claims of caste-based abuse