Treasury Secretary James A. Baker III told congressional leaders yesterday that the government will use assets invested by Social Security and other trust funds to help pay its bills if Congress fails to raise the limit on the amount the government is authorized to borrow by the end of the month.

Under the plan, outlined by Baker in a letter to congressional leaders yesterday prodding them to raise the debt ceiling, the trusts would lose interest on their funds, which normally are invested in Treasury securities. The government later may have to consider selling gold if Congress fails to raise the debt limit, Baker said.

The government may take the unusual steps to meet its needs if Congress fails by Nov. 1 to raise the debt limit from $1.824 trillion to $2.078 trillion, the amount requested by the Reagan administration.

That request is being held up by a balanced-budget proposal the Senate attached to the debt ceiling bill. House legislation did not include a budget-balancing plan, and House-Senate negotiators have made no progress during four meetings in trying to resolve the problem.

Baker said that President Reagan and Attorney General Edwin Meese decided to take the "extraordinary step" of taking back Treasury securities in which the trust funds invested. In addition to tapping Social Security, the government might tap other funds such as the Railroad Retirement fund or military retirement funds. By taking back the notes from the funds, the government would reduce the amount of its debt outstanding, giving it more room to borrow in the open market while remaining under the $1.8 trillion debt ceiling.

However, by taking back the securities in which the trust funds had invested, those funds would lose the interest the government pays on those notes. Baker said that the government would run out of cash on Nov. 1 and be in the red by more than $5 billion by Nov. 4.

However, even reducing the debt by taking back the notes purchased by the funds would be only a temporary measure. "Even if trust funds were disinvested to avoid a Nov. 1 default, we would certainly default on Nov. 15 unless Congress acted before then to increase the debt limit," Baker said.

If Congress does not raise the debt ceiling, the only "legal and practical" option would be to sell U.S. gold. But the administration is "not prepared to take that step because it would undercut confidence here and abroad based on the widespread belief that the gold reserve is the foundation of our financial system," Baker said.

Baker, on another subject, told the House Banking Committee yesterday that most U.S. bankers have reacted positively to his three-pronged plan to ease the internationl debt crisis. The plan, unveiled at the annual meeting of the Internaional Monetary Fund and the World Bank in Seoul this month, would encourage debt to promote economic growth, increase the participation of multilateral finance institutions and increase lending by commercial banks.

Baker also said that only if all three parts of his plan were successful would he come back to Congress "asking for an increase for the World Bank."

The next step in his plan is for the government to talk to the private banks about lending fresh funds to Third World debtors. But Baker said he was not "arm twisting" them into cooperating.

He also said that the government would not waive any lending regulations to assist the banks in increasing their lending to the debtors.

Earlier this month, the Treasury avoided bouncing checks for the first time in history by borrowing funds using an unprecedented and complicated procedure. At that time, the Treasury auctioned $5 billion in short-term bills and then exchanged some nonmarketable securities that it already held for securities of the Federal Financing Bank.

The FFB securities are not subject to the congressionally mandated debt limit, so using them to replace other Treasury debt instruments -- which are subject to the limit -- reduced the amount of debt the government held.