The injured, Naresh, Ajay and Rajesh, were rushed to PGIMS where their condition is stated to be out of danger, police said.
The attack took place on Circular road, when six persons on two motorcycles opened fire at the van in which the undertrials were being taken to District jail at Sunariya village from the district court after a hearing.
An attempt to murder case has been registered against unidentified persons at Civil Lines police station.