There are various precedents that government property splits according to where it is.
Otherwise it would be split like a divorce - and why would either side not want the Scots to have it?
Because the purely commercial track access charges could be pretty extortionate before the Scottish government could politically afford to either cut rail services or forcibly nationalise it for less than open market value (especially a newly independent government which is trying to prove it can have rapid membership of an institutionally liberal organisation on unusually generous terms). That's also assuming HMG aren't trying to punish Scotland or deliberately wreck the country so that they're forced back into union on whatever terms we offer, or to make an example for NI as the Catholic demographic there gradually creeps towards a majority, or just to make a pile of cash having a fire sale of Crown assets in Scotland to anyone willing to gamble on keeping them, in which case all bets are off.
As for the original question, I suspect they'd try to have as close to a fully-integrated national railway as they can sneak past the EU commission and the eager continental investors. There's a few loopholes they can explain for at least a year or so until someone closes them, as well as the classic "ignore the rule until it gets dragged through every possible appeal while wasting as much time as possible, then keep wasting time obeying the court orders" which previously served DB and others so well.
If that doesn't work, they can have the national government informally lean on local authorities to harmonise their local public transport regulators which councils theoretically operate independently (so long as they keep getting grants…), and just franchise out the Inter7Cities and services from England if anyone is enough of a mug to bid for them. Their internal decision making about grants and "suggestions" to local authorities can be based on more realistic assessments of the real cost of services, rather than pretending to believe the track access changes the way anti-rail French politicians do.
At the border, even if they're not allowed to remain in the CTA, old-style on-train passport checks would be possible if someone can ever figure out why UKBA refused to even give quotes for doing it on Channel Tunnel passenger services. They kept doing it even when ministers and governments changed, and even when people offered to pay for an estimate, but AFAIK they never gave a reason, not even an unbelievable one. For the ECML its easy with Berwick and Berwick North stations, assuming the border on the river. If Berwick is made entirely in Scotland the simplest solution is to make the border run into the station.
Network Rail in Scotland would transfer over. After all, whoever owns it, funds it.
Unless HMG wants to treat it as a commercial venture, along the lines of some lines in the rEU. ISTR there are some lines on the Interoperable rail network which are owned by foreign government companies, though all have EU member governments as majority owner (though the CTRL is majority
leased by the Quebec government). After all, commercially operated track networks are part of the idea of the Railways Packages in the minds of the Swedish, UK treasury, and EU bureaucrats that successively dreamed up the rules.