If you still have the epub file, try reconvert it to epub with Heuristic Processing (see the screenshot), check the new epub's TOC using calibre viewer, then convert epub to mobi (if the TOC is not as good as you want, use Sigil to edit the epub).
You could also read
Chapter Detection/Table of Contents Tutorial.