Spain is investing almost three times the GDP of Monaco into upgrading its rail lines.