I read on FlyTalk that the you should be allowed to enter and exit India even if your Visa is attached to an expired passport, as long as your current passport in valid and the Visa had not expired. Just take both the current and expired passport and you should be fine, although there are reports of some confusion by certain border agents (particularly on exiting the country) - but "legally" it is allowed.
For Brazil, you can take your expired passport with the Visa - and we had personal experience with this and worked fine.