The company that runs Scotland's rail services reports losses of £10m after its contract is ended early.