Since 2015, the CIA has spent tens of millions of dollars to transform Ukraine’s Soviet-formed services into potent allies against Moscow, officials said.