China plans to spend heavily on technology to help cities cope with headaches like air pollution and traffic jams—and perhaps unruly mobs and outlaws. Silicon Valley companies are teaming up to seize the opportunity, a trend that could raise the profile of players like Sensity Systems Inc.