The principal duties of the Attorney General are to:
Represent the United States in legal matters.
Supervise and direct the administration and operation of the offices, boards, divisions, and bureaus that comprise the Department.
Furnish advice and opinions, formal and informal, on legal matters to the President and the Cabinet and to the heads of the executive departments and agencies of the government, as provided by law.
Make recommendations to the President concerning appointments to federal judicial positions and to positions within the Department, including U.S. Attorneys and U.S. Marshals.
Represent or supervise the representation of the United States Government in the Supreme Court of the United States and all other courts, foreign and domestic, in which the United States is a party or has an interest as may be deemed appropriate.
Perform or supervise the performance of other duties required by statute or Executive Order.
When it comes to the role of the U.S. Attorney General in "representing the United States in legal matters," there's a bigger question here that is surely worth raising, but the time for it has probably long passed:
What function does the DOJ even serve in prosecuting criminal cases in the first place?
The U.S. Department of Justice didn't even exist until 1870. Before that, Federal crimes were pretty much limited to treason and tax evasion. And the primary function of the U.S. Attorney General was in civil matters like Federal vs. State legal disputes and real estate transactions for Federal lands.