WASHINGTON—Gordon Sondland, the U.S. ambassador to the European Union, criticized President Trump over his efforts to enlist Ukraine in investigating a political rival and said he and other U.S. officials were disappointed by the president’s directive to work with Rudy Giuliani on Ukraine matters.

Mr. Sondland made the comments in prepared testimony to House committees as part of their impeachment inquiry, which is examining the president, his personal lawyer Mr. Giuliani and top diplomats’ dealings with Ukraine.

Democrats...