Twenty-three detainees were killed during a militant attack on an Iraqi convoy transporting them south of Baghdad on Monday morning, officials said.