Embattled Citigroup Inc. and the U.S. have reached an agreement in which the government will substantially increase its stake in the bank and in return will demand a boardroom shakeup , according to people familiar with the matter .