Because whether you worry or not this is something that is going to happen. India is a rising economical power and their investments&cooperation in Iran are more than welcome as Iran is also going to work to become an economical power.
If you think Iran will not allow economical cooperation with India because some neighbour does not like it then you're deluding yourself.
Chahbahar is one strategic port, one which I feel even China will at some point want to get involved in. So stop your moaning and accept reality. Pakistan should just concentrate on developing its economy. A rising Iranian economy does not have to be bad news for Pakistan, matter of fact it can be a good thing. If you keep a friendly attitude with Iran, which most Pakistanis do, then you will have a large and potential economical power to trade & cooperate with. And don't forget you need Iranian energy.
India is the highest recipient of U.S economic aid, home to more poor people than anywhere else on earth, and furthermore faces issues like corruption, rape, growing slums, growing disparity between rich and poor, and child labour. In South Asia its economy and overall human development performance is worse than a tiny Island like Sri Lanka so spare me the 'supa duper power' qualities.
Pakistan is not a perfect country either but its widely acknowledged that its people live in far better quality of life. In a recent analysis done by Bloomberg, it said Pakistan's present economic reforms are better than India's. On top of that China is investing over $46 Billion in the country's infrastructure development which will pave way to connect both countries.
Why would China want to go to Chahbahr when Pakistan shares a border with them and offered them a naval base and lease of Gwadar ? If there is any ally China has in this world and trusts the most, its us. In the past Pakistan stood by China when Mao was isolated by the world. To complement with that, we have a saying to describe our relationship, 'our relations are taller than mountains, deeper than oceans and sweeter than honey'.
So to include China in trade scenarios, its actually going to have to work the other way around. India will face competition anyways because we are in the middle and Iran will have to approach Pakistan, where Gwadar would be the starting point. Pakistan also has good relations with Arabs, which again gives China more chances and opportunities to come to us.
At some point we will get energy and there are plenty of options on the table. Gas Pipelines from Iran and Turkmenistan, LNG shipment from Qatar and Russia, Electricity transmission lines from China and Tajikistan.
It is hoped that the need to import wouldn't be necessary in the next decade as with Chinese assistance some Dams, Solar, Wind, Coal, and Nuclear projects are under construction and Pakistan being listed among top 6 countries in the world in Shale Oil and Gas reserves speaks potential of future projects taking place.