Mr. Putin, who banked on a short, easy conquest of Ukraine when he authorized the invasion in February 2022, is now in a grinding war of attrition.