The ruling Democratic Progressive Party doubled the number of cities and counties it governs but lost the mayoral election in Taipei.