The Bharatiya Janata Party (BJP) emerged victorious in the Milkipur by-election, defeating the Samajwadi Party (SP) in what had become a high-stakes battle of prestige, media reports said.