With high casualty figures and the slow pace of Russia’s territorial gains, President Vladimir V. Putin could face years more of a grinding war of attrition in Ukraine.