Complex sentence: Their main military force under Danylo Zeleny was defeated by July 1919, when, faced with the succesful Denikin offense they decided to terminate military activity and ally with the Bolsheviks as the lesser evil.
Split into simpler sentences: Their main military force under Danylo Zeleny was defeated by July 1919. Faced with Denikin's successful offensive, they decided to stop further military activity and ally with the Bolsheviks as the lesser evil.