The year-long agitation by farmers, widely expected to cloud the ruling BJP’s prospects in western Uttar Pradesh, barely presented a challenge with the party holding on to most of its electoral base in the region and losing only 14 seats over its 2017 score.