DC Motor as DC Generator + Output Polarity Switcher
You can use a simple bridge rectifier to get what you want. This requires that you must rotate the motors with a minimum speed so that the diodes are forward biased and the output is available.