Here when electromagnet is connected to battery, emf source the magnetic field is produced which pushes rod upwards and so gravitational potential energy is stored.This stored energy will require work which will come from current source or battery which is connected to electromagnet.So option 2 is correct answer