Method for the energy-optimized operation of a rail vehicle fleet, wherein the rail vehicle fleet comprises n rail vehicles (4, 4a-4c), each of which comprises a state influencing system for vehicle state influencing, which can generate and/or consume electrical energy, and also a computer unit, and, for all i from 1 to n during operation of the rail vehicle fleet, - while taking into account at least one target criterion for the i-th rail vehicle and depending on vehicle-related, location-related and/or track-related state parameters of the i-th rail vehicle, the computer unit of the i-th rail vehicle of the n rail vehicles (4, 4a-4c) selects an action to be applied to the state influencing system of the i-th rail vehicle, which action contributes to the optimization of a total electrical energy balance of the state influencing systems of the rail vehicle fleet when applied to the state influencing system of the i-th rail vehicle, and - the selected action is applied to the state influencing system of the i-th rail vehicle, wherein i and n are natural numbers and n is greater than 1, characterized in that the computer units of the n rail vehicles (4, 4a-4c) each comprise an artificial neural network trained by a machine learning method, wherein the selection of the action is carried out by the computer unit of the i-th rail vehicle using its artificial neural network, wherein the computer unit of the i-th rail vehicle is trained from an initially untrained state by means of said machine learning method to select an action to be applied to the state influencing system of the i-th rail vehicle during operation of the rail vehicle fleet taking into account at least one target criterion for the i-th rail vehicle and depending on the vehicle-related, location-related and/or track-related state parameters, which action contributes to the optimization of the overall electrical energy balance of the state influencing system of the rail vehicle fleet when applied to the state influencing systems of the i-th rail vehicle, wherein the action is selected by the computer unit of the i-th rail vehicle taking into account multiple target criteria for the i-th rail vehicle, wherein at least some of the target criteria relate to a vehicle interior temperature of the i-th rail vehicle, a temperature of a vehicle component of the i-th rail vehicle, an upper limit for a contact line voltage at the location of the i-th rail vehicle, a lower limit for a contact line voltage at the location of the i-th rail vehicle, a permissible minimum distance from a rail vehicle ahead and/or a permissible minimum distance from a rail vehicle behind. - while taking into account at least one target criterion for the i-th rail vehicle and depending on vehicle-related, location-related and/or track-related state parameters of the i-th rail vehicle, the computer unit of the i-th rail vehicle of the n rail vehicles (4, 4a-4c) selects an action to be applied to the state influencing system of the i-th rail vehicle, which action contributes to the optimization of a total electrical energy balance of the state influencing systems of the rail vehicle fleet when applied to the state influencing system of the i-th rail vehicle, and - the selected action is applied to the state influencing system of the i-th rail vehicle, wherein i and n are natural numbers and n is greater than 1, characterized in that the computer units of the n rail vehicles (4, 4a-4c) each comprise an artificial neural network trained by a machine learning method, wherein the selection of the action is carried out by the computer unit of the i-th rail vehicle using its artificial neural network, wherein the computer unit of the i-th rail vehicle is trained from an initially untrained state by means of said machine learning method to select an action to be applied to the state influencing system of the i-th rail vehicle during operation of the rail vehicle fleet taking into account at least one target criterion for the i-th rail vehicle and depending on the vehicle-related, location-related and/or track-related state parameters, which action contributes to the optimization of the overall electrical energy balance of the state influencing system of the rail vehicle fleet when applied to the state influencing systems of the i-th rail vehicle, wherein the action is selected by the computer unit of the i-th rail vehicle taking into account multiple target criteria for the i-th rail vehicle, wherein at least some of the target criteria relate to a vehicle interior temperature of the i-th rail vehicle, a temperature of a vehicle component of the i-th rail vehicle, an upper limit for a contact line voltage at the location of the i-th rail vehicle, a lower limit for a contact line voltage at the location of the i-th rail vehicle, a permissible minimum distance from a rail vehicle ahead and/or a permissible minimum distance from a rail vehicle behind.