If I want to spend more than 3 months in the US, can I use my passport B?
Yes, because your passport B has a visa in it that lets you stay more than 3 months.
Do I have to apply for ESTA just because I have the passport A even if I use my passport B?
No. You only need ESTA If you plan to use the visa waiver program (VWP) to enter the US without a visa. Since you don't plan to do that, you don't need ESTA.
Can I use my passport A to enter US but stay for more than 3 months?
Yes, but only if you get a separate B visa on that passport A. Without a visa in passport A, you can only use passport A under the VWP, in which case you are limited to 90 days (not 3 months).
If I need to use my passport for identification for a legal matter or for banking, do I have to provide the passport I used while entering US?
In general, no. If you need to prove your immigration status rather than just to identify yourself, however, you will probably need to use the passport you used to enter the US as that is the one that will match your I-94 form.
Do banks or government institutions require me to show the passport issued by the same country every time I interact with them, or can I use my passports interchangeably?
This will depend on company or agency policy, which in turn will depend on why they're asking you to identify yourself and on whether they've recorded your document information as a security measure. Some agencies certainly don't care; the TSA is an example. Others might. I recently had trouble cashing a check at my bank because I had forgotten my driver's license and they didn't want to accept my passport as identification because I had never "added it" to my account. The fact that all the biographical data matched and the signature matched the one I had on file with the bank was not sufficient.
I suspect, however, that you are overestimating the adverse impact of using the less reputable passport. If I were you I'd probably just use it exclusively to keep things simple.