If you read between the lines, you will understand that neither the Gita nor the Mahabharata advocates war with weapons. Also, the consequences of war described in the Mahabharata indicates that wars with weapons bring only miseries. If you read this part of the Mahabharata you will never say that the Gita and the Mahabharata is for war with weapons. It was due to Arjuna’s misunderstanding another Gita (Anugita) became necessary.
The Anugita contains sections on what constitutes the duties of a good
human being. For example, in chapter 23, it states the best quality
and the duties of the good are:
Joy, pleasure, nobility, enlightenment and happiness also, absence of stinginess, absence of fear, contentment, faith,
forgiveness, courage, harmlessness (ahimsa), equability, truth,
straight forwardness, absence of wrath (akrodha), absence of
calumniation, purity, dexterity, valor. (...) Devoid of the notion
that this or that is mine, devoid of egoism, devoid of expectations,
equable everywhere, not full of desires, to be such is eternal duty of
the good.
— Anugita, Translator: Kashinath Trimbak Telang
A man, if he has been transformed into a new man by listening to the Gita, he will never go into battle armed. So Krishna's advice was not to fight with weapons; but many people who didn't read the Mahabharata or the Gita believe wrongly.
For more details:
https://www.wisdomlib.org/hinduism/book/the-anugita
The word Kshatriya etymologically means one who saves others from wound.
This quote is from the Gitat https://asitis.com/3/37.html . All these show that the enemies are not outside but inside.
The ‘weapon of knowledge’ mentioned in the Bhagavad Gita should not be unnoticed.
How did Krishna justify war?
War is always happening inside everyone. So ‘fight’ is necessary to win the ‘war’. In this sense Krishna justified war.
A 'panacea' (the Gita) for people working in different walks of life should not be misinterpreted as a mere battle or war using weapons. If it were so, billions of people should have already died after reading these scriptures.
The Mahabharata says that even Arjuna misunderstood Krishana’s words as an exhortation to fight with weapons. I believe that no religion, if properly understood, can be interpreted as an advice for killing others.