The Samajwadi Party founder breathed his last on October 10 at Medanta Hospital in Gurugram.
Deputy Superintendent of Police (Rasra) Shiv Narayan Vais said Markandeya Swarnkar and Ajay Verma, both residents of Nagra, were arrested on Thursday for the objectionable post against Yadav on Facebook.
They were accused of disrupting peace, following which action was initiated, he added.
Vais said the arrested accused had allegedly compared the former Uttar Pradesh chief minister to Ravana, the demon king in the Hindu epic ‘Ramayana’, and also made an objectionable comment about him.
On Thursday, Samajwadi Party workers submitted a memorandum demanding action to the Nagra police station SHO.