Indeed, this is what we do, and in the last three years, we have paid all our surplus to the government. Separately, the government can infuse capital into the banks. The two decisions need not be linked.
Alternatively, a less effective form of capital, if the government cannot buy bank equity directly with cash, is for it to issue the banks “Government Capitalization Bonds” in exchange for equity. The banks would hold the bonds on their balance sheet. This would tie up part of their balance sheet, but would certainly be capital.