I think it's a bug, when you tell it to train the maximum amount of troops possible (restricted by population), it tries to split them evenly, but cannot as it rounds up or something, and ends up telling the last barracks to train more troops than there are people left in your city, then it tells you that you cannot train due to insufficient population, and that last barracks is left empty, you should see that you have some population left over as well. You can get around it by telling your barracks to train slightly under the maximum amount of troops possible, and then that won't happen. If it has already happened, you can put a manual training into that one barracks roughly equal to the time that the others have left to fix the inefficiency.