High-speed rail (HSR) is often claimed to bring different regions and cities closer together by shortening travel times, which can reduce the costs and increase enterprises productivity to promote a sustainable economy. However, another view argues that HSR transfers economic activities from peripheral cities to core cities, resulting in unbalanced regional economic development and damaging the sustainability of the economy. Based on microdata from China, this paper empirically investigates the impact of HSR on the enterprises productivity in both core cities and peripheral cities and explores the impact mechanism from the perspective of allocation effect and distribution effect caused by HSR. The results show that the connection of HSR positively affects the enterprises productivity in core cities, while it negatively affects the enterprises productivity in peripheral cities, with effect values of 1.38% and -8.45%, respectively. The conclusion still holds after endogenous treatment and multiple robustness tests are conducted. Additionally, the allocation effect analysis shows that the market access caused by HSR has an optimization effect on the resource allocation efficiency of both core cities and peripheral cities. The distribution effect analysis reveals that the distribution of enterprise productivity in peripheral cities has market heterogeneity, regional heterogeneity, and location heterogeneity. The important policy significance of this paper is that, in order to promote the sustainable development of enterprises and the economy, it should reduce policy restrictions and promote the effective flow of capital and talents, carry out the dislocation development of industry for peripheral cities, and “build a nest to attract the phoenix.”