The Haramain High Speed Rail system is to transport Muslim pilgrims, as well as regular travellers, 450 kilometres (280 miles) between the holy cities of Mecca and Medina via the Red Sea port of Jeddah.
Saudi Arabia signed a deal three years ago for a Spanish consortium to build the rail track, supply 35 high-speed trains and handle a 12-year maintenance contract.
The Saudi Bin Laden Consortium and Saudi Oger Joint Venture received contracts for four stations, while Al-Rajhi Alliance in 2009 won the bid to construct bridges, culverts and similar work.
But during a two-day inspection tour last week, the kingdom's new Transport Minister Abdullah bin Abdulrahman al-Muqbel warned that time was running out, his ministry said in a statement obtained on Wednesday.
After visiting the Mecca station and bridges along the route, Muqbel told the contractor -- which was not named -- "to present an urgent plan to avoid delays within the next two months," by increasing the workforce and supplies.
"This is also considered a final warning either to commit and improve performance or face the consequences," the ministry said.
Signup to our newsletter and follow us on Facebook and Twitter!
Jeddah station was "in its final stages" and Muqbel ordered that it be delivered immediately, while "qualified contractors" should be hired for the nearby bridges in order to avoid holdups.
Work at another station, King Abdullah Economic City, was complete.
Muqbel also met with the Spanish consortium "and discussed with them the delays in some of the sites... and the delays in the supply of necessary equipment and trains," stressing every effort must be made to complete the work on time.
The Spanish consortium includes state rail network Adif, train manufacturer Talgo, technology company Indra and rail builders OHL.
Spain has become a world leader in high-speed rail networks and now has the longest such system in Europe, ahead of France, which pioneered the technology.
Saudi Arabia is expanding its railways, including with a $22.5 billion metro system under construction in the capital Riyadh.
A consortium involving Spain's FCC is part of that project.
The annual hajj, which is to be held in September next year, attracts about two million Muslim pilgrims to the Mecca region.