The best way to avoid a problem is to buy before you board. If the service/ speed of service is poor complain. In a penalty fare area you may have to deal with revenue protection, who may choose to prosecute or threaten to prosecute. If this happens it can at a minimum lead to a lot of inconvenience. Remember many people arrive at a station at the last minute choose to board without queuing and may also avoid paying for a ticket. We all end up paying for their fare avoidance. Of course If the machine was not working you can buy later. However if the user before & after your transaction made successful transactions it could be difficult to prove it wasn't working in court.
So just for clarity how long before departure should intending passengers arrive at the station?