I'm simplifying a bit, but a company is just a device for generating return on investment, and whatever maximises ROI is what it should do.
Really? Do you have an authoritative source for that or are you just quoting internet memes about it?
Not really, but nearly. The UK law is the Companies Act 2006, which states: "Directors must: act in the way they consider, in good faith, would be most likely to promote the success of the company for the benefit of its members as a whole."
(Where "members" = shareholders.)
However, it is not a directive to maximise profits
at all costs. The Act requires the directors to consider: long-term consequences; employees; relationships with suppliers/customers; community and environmental impact.
So, there is a duty to promote company success, benefitting shareholders over the longer term, but not at all costs.
It's a lot more complicated in the US because the relevant legislation is at state level, so I'll leave you to look that up. 😄
EDIT: to refer back to the original point, @jonovid suggested sacking the Indian directors "that put shareholders over its customers". The wording is imprecise, of course, but as you can see it is not unreasonable to ultimately put the needs of your shareholders first, because they are the ones investing their money in the company, and the main reason they are doing that is to make a return. Maybe not an immediate return, but eventually.
Your obligation to the customer normally extends no further than delivering what you promised for the price you promised.