In re-examining "The Darkest Days of the War ..." over the long weekend, according to Cozzens (pg 133), Captain William M. Wiles (22nd Indiana), the U.S. Provost Marshal responsible for such a grim duty, found 265 Southerners "on the field" and buried them.
Wiles' number (265) equates to the reported number of unidentified men in the mass grave (265) at Shady Grove in Iuka; therefore, I would believe the trench contains only the remains of those killed outright in the battle proper, and would have been closed within a matter of days of the end of active fighting.
Hope this helps.