Is energy always conserved?

Hi I am Ayush and I am from India.
I would like to ask a question from your video  of energy conservation...
Can we create a car in which we have two motors at the front wheels and at the rear wheels, each have a battery connected to it. First we run the car with one battery first such that when one motor(in the front wheels,powered from the battery) runs the car the other motor gets charged due to rolling of the wheels(rear wheels)... Then when the front battery gets dead we run the car from the power of battery in the rear...and so on we keep swaping the power sources and run the vehicle..
Also keeping in mind the loss of energy to friction and other things...Please tell me if it is possible..