JAKARTA - Earlier this year, as Japan's Prime Minister Shinzo Abe was considering teaming up with arch rival China to help deliver infrastructure projects under the country's US$1 trillion Belt Road Initiative (BRI), his ambassador to Indonesia was overseeing the finishing touches of an early study to construct a railway between Jakarta and the country's second city, Surabaya.
At stake was a rare chance to lock in Japanese standards for signalling and other rail technology as South-east Asia's biggest economy overhauls a rail system dating back to the Dutch colonial era.
Chinese contractors had beat Japan three years ago to the US$5 billion (S$6.9 billion) high-speed railway between the country's capital and its third city Bandung 150km away but that project was stuck amid troubles acquiring land. Although there was no tender yet for the 800km Surabaya link, winning it would more than make up for the loss.
"That is how it goes," Japan's Ambassador to Indonesia Masafumi Ishii said.
"Creating the system. Creating the standard. Getting there first. That is a very, very important aspect to competition. There is nothing to hide about that."
The comments reflect the intensifying contest between the two infrastructure behemoths - each hell bent on setting standards, securing trade routes and locking in clients throughout the world's fastest-growing regions.
In October, Mr Abe proposed to his Chinese counterparts during his official visit to Beijing, the first for a Japanese prime minister in seven years, the two countries team up on projects.
But after a year that saw China stumble badly from project cancellations and accusations of predatory lending, Japan may be more inclined to press home its advantage.
Japan's ultimate goal, analysts say, is to keep China in check, while threading rail, port and communications projects from South-east Asia to Africa that can boost economic growth and investment in Asia and Africa over the coming century - an initiative it calls the Free Open Indo-Pacific (FOIP).
"The prospect of Japan seriously contributing to the BRI remains distant," said Mr James Brown, professor of international relations at Tokyo's Temple University. "China is perceived to be the main, long-term strategic threat to Japan, meaning that the BRI, along with other Chinese foreign policy initiatives, are viewed with suspicion in Tokyo."
"The way in which the FOIP has been promoted also indicates that Japan has China's BRI in mind," Mr Brown said.
The BRI has had a particularly bad year.
In Malaysia, the government of Tun Dr Mahathir Mohamad cancelled US$22 billion in rail project and pipeline projects.
In Laos, the legions of Chinese workers that have followed the US$6 billion high-speed rail project linking Kunming in China with the capital Vientiane has stirred up local resentment and rumours that thousands of them are intent on staying.
In Sri Lanka, a lease- for- debt swap for Hambantota Port may have netted China a valuable asset on the periphery of its rival India but the trade-off has raised suspicions that China is peddling in predatory loans to gain influence.
And in Indonesia, with around half of the land needed for track and stations on the Jakarta Bandung railway still outstanding, work is already three years behind schedule.
The difficulties reflect the inexperience of Chinese officials working in Asian democracies, where consensus building among local elites and the bureaucracy and not diktats from the capital is the key ingredient in policymaking, analysts say.
Mr Rene Pattiradjawane, a researcher at the Centre for Chinese Studies in Jakarta, says at the end of 2018 Japan's infrastructure brand is burnished while China's is bruised.
"The BRI is a wounded beast," Mr Rene said.
"It's clear from these setbacks that President Xi Jinping's inner circle don't know how democracies work."
Unveiled five years ago, the BRI, through China's state-owned engineering companies and its banks, has splashed out more than US$210 billion on ports and rail - mostly in Asia.
For now, though, Japan remains Asia's dominant infrastructure investor. Since 2000, Japanese infrastructure investment in Asia has added up to about US$230 billion, according to research published last year by BMI Research, which has since been bought by Fitch Solutions. Chinese investment accounts for about US$155 billion, the report said.
Japanese staying power, in part, is linked with decades of engagement in the region following World War II and a meticulous step-by- step approach to projects, says Mr Tom Lembong, chairman of the Indonesia Investment Coordinating Board, which oversees foreign direct investment.
"The Japanese are very methodical and the Chinese are very aggressive," Mr Lembong said. "The Japanese like to break down projects into stages," he added.
Mr Lembong said Indonesia recently granted a 20-year tax holiday to Japan's Sumitomo Corp, the Kansai Electric Corp and Indonesian conglomerate Astra Group. The companies comprise a consortium that is building a 2,000MW coal-fired power station in Central Java that will nearly double the joint venture's generating capacity at the site when it goes into operation in 2021.
Sumitomo insisted on the tax holiday to ensure the government was serious about the US$3.9 billion project, Mr Lembong said.
"These things are a statement of intent," Mr Lembong said. "They signal the government's strong commitment to the project."
Next year, the Mitsui-Sumitomo-led Japanese consortium building Jakarta's first MRT will wrap up work on the first stage of the system. While the MRT has been in the planning stages since the 1980s, work got started on the US$1.2 billion project only after Japanese lenders secured government guarantees that the operating company will repay the debt.
But China's deep pockets and the sheer scale of demand for newer, more efficient ports, faster and safer trains and more comprehensive public transport means Japan is steadily losing ground to China.
The World Bank said last year that bringing Indonesia's infrastructure up to par with its emerging market peers such as Thailand would require US$1.5 billion. Annual foreign direct investment from China into Asean member countries nearly doubled during the three years to 2017. Japan's FDI has been more or less steady during that time at about US$13 billion a year, according to Asean data.
For its part, Japan has earmarked just over US$200 billion for infrastructure though the Asian Development Bank and in development assistance though the Japan International Cooperation Agency.
As it secures trade links and clients between Asia and Africa, Japanese officials hope to manage their relative decline and coax China into relying less on cheap money and more on methodical planning, Mr Ishii said.
"We would like to see China's initiative more quality oriented. That's our wish. We are happy to distinguish our high quality projects from China," Mr Ishii said.
"They need to adopt a higher standard, which I think they know."