I don't remember being desperate in Bergen, but we spent a few hours on a local fjord cruise and I guess the toilets on the boat were free. As Bergen is a terminal rail station, trains wait there for some time and I may have boarded a train to use the toilet without intending to travel.