Cycling fast - and brakes don't work - what to do? I hope this doesn't occur to any of us, but it can.

What must the cyclist do when he/she is cycling (too) fast and needs to stop or slow down immediately, but neither the front and rear brakes work at that moment (for whatever reason), and there is almost no way to avoid collision without stopping/slowing down?

Are there any recommended actions/maneuvers to try in order to stop the bike and/or avoid/minimize the potential dangers?

Well, a possible action is to try stopping the bike with one or two feet. What if they cannot reach the ground (i.e. the saddle is high)?
First, I'm sure you've already considered this, but for future visitors: don't get into this situation. If you're at all unsure of your brakes, stop riding until you can get them fixed. Brakes don't just stop working for no reason. Most cyclists should never experience this.

Second, are you sure you have to stop right now? If you're on the flat, you can come to a gentle halt just by sitting up in the saddle (to make yourself less aerodynamic) and waiting a minute. This is certainly preferable except in an emergency. If it really is an emergency, and you must stop in the next few seconds to avoid a brick wall, cliff edge, boiling lava, &amp;c., do the following:

Manoeuvre to somewhere it is safe to do so, and then put your weight on one side so that you fall over sideways. You need an empty space a few metres long (depending on surface conditions and speed) to be sure you won't hit anything. If you're on a road, hitting a high kerb at an angle should help you land on the footpath. If you're in parkland or countryside, a hedge or bush is a much better option than a drainage ditch.

Be careful that even though you know a fall is coming you don't tense up: keep your joints loose and tucked in. Even at a fast cycling speed, if you stay frosty and alert you should be able to walk away from a deliberate fall like this with some bruises, no broken bones or head injuries.