Magnetic Pressure providing the lift or attraction between two magnets is defined as
$$P_b = {{B^2}\over{2\mu_o}}$$
$B$ is the vector sum of the two magnetic fields expressed in Teslas.
The Earth's magnetic field is on the order of $100 nT$, roughly a million times weaker than the refrigerator magnet. Plus, as has been ably observed in other answers, it is aligned along the earth's surface, except at the very poles of our planet where it has a radial component.
So your robot couldn't use the Earth's magnetic field to levitate except may be possible at the South Pole -- since the North Pole isn't really a place you find mines. Then, if you robot could generate a field powerful enough to generate lift it would also be attracted to ferromagnetic compounds in the Earth -- which would generate a much stronger $P_b$ pulling the robot back towards Earth.
If your robot was mining a huge quartz deposit and there weren't any ferromagnetic materials for many many miles, and lightning struck the ground, then you could plausibly have enough induced magnetic and e-fields from the current in the lightning and the piezoelectric effects of the quartz to generate a burst of magnetic field that would be radial from the point the lightning hit.
Quartz is found in conjunction with gold deposits. So if your story was set in a desert with the notable absence of iron, nickel, aluminum, and other ferromagnetic materials, then with a lot of hand waving, your robot could use both the magnetic pressure and the resultant Lorenz Force from the charge and B field interacts to fly, briefly.
It is, in truth, preposterous but for your story, meh, it could work.