TOKYO, July 3 (Reuters) - The yen weakened to a fresh 38-year trough to the dollar and a record low to the euro on Wednesday, as the currency continued its downward grind, with Japanese officials largely remaining on the sidelines amid the risk of intervention.

The dollar firmed, recouping ground lost on Tuesday, when dovish comments from Federal Reserve Chair Jerome Powell overshadowed a robust domestic jobs report.

The euro remained resilient, helped by a stubbornly high local inflation reading on Tuesday that suggested the European Central Bank would take its time before cutting interest rates again. Sterling was steady ahead of Thursday's UK election.

The yen slid about 0.2% to reach 161.875 per dollar for the first time since December 1986, and eased by about the same margin versus the euro to reach an all-time low of 173.80.

Japanese authorities have been largely quiet on the yen this week, with Finance Minister Shunichi Suzuki only commenting on Tuesday that moves were being watched vigilantly. He refrained from repeating the oft-used warning that the ministry stood ready to act.

Atsushi Mimura took over as the ministry of finance's currency czar on Monday, replacing Masato Kanda, who oversaw the 9.8 trillion yen ($60.67 billion) round of intervention spanning several days in late April and early May, when the currency plunged to 160.82 per dollar.

"I feel like there was an abundance of expectations that there would be some action from MOF on Monday, and that hasn't happened," said Bart Wakabayashi, branch manager at State Street in Tokyo. "Maybe there's some testing of the authorities."

"I know there's been a change at the top, but that's no reason to go silent," he added.

Some speculated authorities could act on Thursday, when thin liquidity due to a U.S. holiday would exacerbate market moves. Wakabayashi, however, said it might be hard to justify intervention when the yen's decline has been so orderly.

Analysts have also pointed to the increased possibility of a second Donald Trump presidency as having an impact on the yen, because Trump's policies are seen as likely to lead to higher U.S. bond yields, which the dollar-yen pair tends to track.

"A Trump presidency would likely bring higher fiscal deficits, inflation and yields at the mid- to long-end of the U.S. rate curve, countering the impact of Fed rate cuts," and the rising risks of that have "moved the goalposts higher for USD/JPY", said Tony Sycamore, a markets analyst at IG.

The dollar index, which measures the currency against the euro, sterling, yen and three other major peers, strengthened 0.1% to 105.78, clawing back most of its 0.14% retreat in the previous session.

Fed boss Powell said at a European Central Bank conference in Sintra, Portugal, on Tuesday that the U.S. economy has made significant progress on inflation, even as he added that more supportive data is needed to start cutting interest rates.

U.S. data overnight showed job openings had increased in May after posting outsized decline in the prior two months. The closely watched monthly payrolls report is due on Friday.

Euro zone inflation eased last month, but a crucial services component remained stubbornly high, fuelling concerns that domestic price pressures could stay at elevated levels.

The euro edged 0.07% lower to $1.0739, but still traded near the top of its range since mid-June.

Sterling held its ground at $1.2680 after rising 0.28% on Tuesday.

The opposition Labour party is widely expected to win in Thursday's poll, ending 14 years of Conservative government. The UK's tight finances mean any new government will have little room to up spending, potentially removing a catalyst of sterling weakness and keeping volatility contained.

Elsewhere, the Australian dollar rose 0.11% to $0.6675, helped by better-than-estimated retail sales data, which kept the risk alive of another Reserve Bank rate hike.

China's yuan slipped to an eight-month trough in offshore trading amid signs that local authorities are willing to tolerate the currency's decline. It was also given a nudge by the lowest reading since October for the Caixin/S&P Global services purchasing managers' index (PMI).

The yuan fell as low as 7.3114 per dollar for the first time since Nov. 3, 2023.

($1 = 161.5300 yen)

(Reporting by Kevin Buckland; Editing by Muralikumar Anantharaman and Sherry Jacob-Phillips)