I wouldn't do it, personally. I would suggest popping each cap and squirting a bit of fresh yeast in there, preferably one that is ok with higher alcohol levels.
It would be hard to keg from the bottle without risking severely oxygenating the beer now. And since it's an imperial stout, it *might* take a while to drink it all, meaning there is a good chance that oxygenation would be noticeable before too long.
If the beer was flat and sweet, it means the yeast either died, or there wasn't enough of them to give carbonate the beer. Or possible that they were stored at a temperature too high or too low for fermenting.
If it was not sweet, then you either didn't get good mixing when bottling, or the beer fermented in the bottle but the CO2 leaked out.
If you are set on kegging, then I would carefully pour the beer in a bucket to limit the splashing, and then siphon gently into the keg. I'm afraid that trying to pour each bottle into the keg would cause a LOT of splashing.