HONG KONG — Hong Kong prosecutors said on Wednesday that they would not pursue charges against the territory’s previous leader, who had received millions of dollars from a company that also had a contract with the city’s subway system.

The former leader, Leung Chun-ying, who was Hong Kong’s chief executive from 2012 to 2017, came under suspicion in 2014, when it emerged that the Australian company UGL had agreed to pay him $6.4 million.

UGL has extensive connections with the MTR Corporation, which runs Hong Kong’s subway, and held a longstanding contract then worth about $41.9 million to maintain 120 train cars.

The allegations of conflict of interest added to calls for Mr. Leung’s ouster during the Umbrella Movement, the large-scale street protests in 2014 calling for more open democracy.