If a soldier is on-duty, they will be eating/sleeping/drinking or on-duty (because if it is not a crisis of health, they are on-duty, this is not a choice). They will stand around with the job "Soldier (no activity) if there is no place for them to train. Your sheriff was hauling items, therefore he was off-duty (and there is a reason he can be off-duty while the others in his squad are on-duty).
"Train 2 minimum" means "try to assign 2 guys to this order before looking at the next order on the list", so it does function as a maximum.
The sheriff probably was off-duty because "Train 1 minimum" plus "Train 1 minimum" plus "Train 2 minimum" only requires 4 dwarfs from that squad to be on-duty during a month, and with 5 dwarfs in the squad, someone gets a month off while the other four are on-duty. One guy can run around and haul stuff, the others are on-duty. So, that "preferred" flag only matters if that preferred dwarf is on-duty that month. If that preferred dwarf is not available, some other will be assigned to fill order#1. I would guess you watched sheriff for less than a month and it was during his off-duty time.
All that being said, his duties as sheriff might give him some options to avoid being on-duty as a soldier.
EDIT: Also, when the guy went to start training and immediately left to do something else, he probably started an Individual Combat Drill (something off-duty soldiers do in their free time), but then he was assigned a job and stopped his training.