A bench of Justice R K Mishra passed the order while hearing a bail petition filed by Yadav.
Yadav, however, would not be able to come out of jail as he has not got bail in other pending cases.
Earlier in May, a lower court at Gaya had rejected Yadav's bail petition.
Yadav and Rajesh Kumar, bodyguard of his wife, suspended JD(U) MLC Manorama Devi, were arrested on May 8 for allegedly helping the accused escape.
Class XII student Aditya Sachdeva was shot dead allegedly by Rocky Yadav for overtaking his vehicle near police lines in Gaya district on May 7 last.
Rocky was arrested on May 10 from his father's mixer plant located at Mastpura village.