Elephants can't digest enough calorie rich food to be able to do this. They individually have to spend longer eating.
[1] https://acoup.blog/2019/08/02/collections-war-elephants-part...
Armies yes. Standing, not so much no. Human history is 100,000-200,000 years. That would be < 3% of human history. To do this, humans had to invent pre-feudal client/vassal networks of specialized food producer and warrior classes. This for the very reason that most humans had to spend most of their time in the act of producing food.
Very few societies could afford a large standing army. There would be one or two village watchmen to keep watch over night. The king might have a dozen guards that were well trained. The bulk of the army was farmers conscripted a few weeks before at need, and sent back home when done. The economies just couldn't support more when 95% of the total human population had to be a farmer just to grow enough food.
There were exceptions. The Romans did manage to hold large standing armies, but they were exceptions.
That is not at all now it has gone for most of human history. Feudalism and its ancient world precursors, an entire religious-social-economic system of vassalage, was necessary concentrate the tiny bits of surplus food into long standing specialized military forces.