Does the Department of Justice represent the US in court?

Yes. The Office of the Solicitor General, which is part of the Department of Justice, represents the United States' interest in court. As of February 2011, Neal Katyal is the acting US Solicitor General. He succeeded Elena Kagan who was elevated to the US Supreme Court bench.