An attorney for Pacific Gas and Electric Co. defended the company’s tree trimming to a federal judge Tuesday, describing its efforts to prevent more wildfires by heavily clearing vegetation around power lines as necessary and unprecedented in reach, even while conceding some major flaws in the program.