How did the sideboards come to be raised over a hardwood floor?
Plenty of homeowners put carpet over hardwood in the 60s, 70s and 80s. It's not clear why the baseboard and base shoe are elevated, though. Normally shoe isn't used with carpet. 

To avoid unsightly lines left on your walls, I'd remove just the shoe, finish the floor, sand and paint the baseboard (in place), then reinstall the shoe tight to the floor.