In the US you may have more trouble. Although I think resale of software that was provided on physical disks was upheld in a court case, resale of purely digital goods was not. A company lost a case for reselling mp3's (whether there was more to it, I'm not certain). It would seem likely that a similar fate would happen to anyone reselling ebooks.
Either way, even if the law says you can, you probably still can't guarantee not having a law suit filed against you. If there's plenty of precedence in your favour though, might be easier to find a law firm willing to take it on for free with a view to getting their costs back from the other side. But I've no idea how the legal system in the US works, I'm not that sure on ours tbf