What are you talking about? They were paying for most of infrastructure spending in Afghanistan before Taliban took over. They are not an authoritarian regime like China, so they don't force aid recipients to use American companies and labour like China does. Many projects in Afghanistan were executed by Indian companies and funded by Americans. They are the major donor for multilateral agencies as well.
Yes, all of Chinese manufacturing won't move to India, but there are going to be enough exports from India to Middle East and Europe to justify India's investment in the corridor.
Vietnam may have a good education system, but there is no comparison with the quality and quantity of Indian engineers. CEOs of major American companies have been educated in India. So they will naturally have an affinity for India.
Obviously, both are developing countries. Even China is not a rich country . India is technologically more advanced than Bangladesh in most areas and has a much bigger economy in absolute terms, but there are still large pockets of backwardness in India. However, most people won't claim BD is richer than India just because its currency is slightly overvalued right now.
Also, the direction of trade is not unidirectional. One major strategic advantage for India will be a much shorter link to Israel which is an important defence and technology partner.