SHANGHAI—A national project to replace millions of gasoline-fueled taxis, buses and trucks with new electric models is boosting China’s ambitions to lead the global shift to battery-powered transportation.

Signs of progress can already be found on American—and Chinese—roads in the form of electric buses and vans built by Chinese makers.

When...