The exchange of braking energy between the trains: determinist analysis and proposal of a probabilistic one