The simple answer is to look at what works best in other countries. (Hint - it's not privatisation....)
If we were to look how railways are structured/are being structured in Europe then we'd end up with something like this:
A limited company with the government as sole shareholder with wholly (or perhaps partly) owned subsidiary but separate infrastructure and operating companies (e.g Germany). The alternative would be for infrastructure to be a statutory agency and operations being a Ltd company, again with the government as sole shareholder (Netherlands, Sweden).
Long distance and freight would be operated on a commercial basis with the state owned company operating alongside and competing with open access passenger and private freight operators. Regional and local services would be specified and funded by local or regional transport authorities and tendered on a competitive basis, with contracts being awarded to the national operator and others (I understand non-DB operators have around 40% of regional market in Germany now).
Unlike our regional sized franchises PSO contracts in many European countries seem to be awarded to operators on a line by line basis or by bundles of two or three lines, meaning a regional transport authorities will award to two or more opertors at the same time.