A) They have to wait 5 minutes (pointlessly) plus the duration of the next person's stay. B) They pay to bump the person behind in the queue.
Both scenarios are bad. In A, the toilet is not being used to its effective capacity. In B, paying customers can prevent non-paying customers from ever getting to use the toilet.
Toilets should be provided for free to customers by private businesses, and to the general public by cities. The alternative is alleys reeking of urine and feces. Toilets: a worthwhile public expense.