There is a similar question was asked before: How can I convert IDX/SUB DVD subtitles into a text SRT subtitle file? more than 6 years ago and the solution is to deal with OCR. There are online tools out there for such conversion, and they just ask to upload the Sub+Idx files and do the job.
I wonder if there is any desktop software for Ubuntu, which can do it offline.