Well with no ticket machine or ticket office you obviously can't buy before boarding.
True, if that was the situation, but it's possible there was a bog-standard ticket machine not linked to the TOD system on the platform, however whether that would qualify as opportunity to buy before boarding may be debatable. And whether there is a requirement to buy before boarding if you have a problem such as this and no staff are available to advise, is also debatable and I would say highly questionable.
The correct course of action depends on the detail of the journey. If it was one train then you'd have to buy again on board and claim a refund later. If it was a connecting train then you might get away with just buying to the change station where hopefully the ticket machine might be working. Indeed if the connecting train was DOO or the guard didn't get to you, it might be possible to be escorted to the machine to get the ticket without going through the palava of a new ticket and refund.
Indeed, I was thinking along those lines.
Plus I think it's easier if you buy from the same TOC that you start your journey from. For a start they can't use the "It's not us, it's another company" excuse (that really is pathetic but I do hear it).
Arguably you could not have any cash and the card may not necessarily have credit on it, so you could get a UPFN. This would in some ways be easier to not pay on the basis that the TOC would be pursuing you, and in the event of a dispute resulting in a stalemate situation you would not pay. However a UPFN may be harder to contest if the issuing TOC was not the same TOC that you couldn't collect from and/or the TOC that you booked with. Not that it should change the legal or moral position in
my opinion.
Hence why I generally book with EC, it's their website, their machines, their staff, and usually their trains I am using. Plus, they're good at rectifying problems unlike certain others e.g. the awful anti-customer EMT, SWT etc.
As is often the case, we don't know the facts, and someone comes along with a statement that is, shall I say,
unlikely to apply, we then have several posts debating why their uninformed basic statement needs to be re-examined, depending on the circumstances. I know I said I didn't want to comment without knowing the facts, but once poor advise is given out and a debate ensues, I feel compelled to!