Using a small Li-Po as a backup power source for a model
If you can get your trolley power to 5V with a buck regulator module or whatever, you can use a USB-powered LiPo charging module to charge the battery. 

Chinese modules based on the TP4056 from NanJing Top Power are popular at the moment. 

However, powering the motors and the Arduino from the same supply may cause issues with start-up surges. You could consider a relatively large reservoir capacitor and Schottky diode to isolate the Arduino from momentary drops in the battery voltage.