Is there a way to obtain the password by comparing the same file, inside and outside the rar?
Without getting into to much detail, its like like me handing you a book in a foreign language after I removed letters from every word and rearranged all the pages. Would you be able to recreate that entire book in English? Probably not. And when I say probably, I mean no.
But that doesnt mean you cant recover the data. The weak link in the chain is the password. There are rar password crackers out there and they work. However, they use dictionary and bruteforce methods. The dictionary attack is useless, as you said you used a randomly generated password. A dictionary attack uses -well a dictionary. It may use a real dictionary and commonly known non-word passwords. The brute force method will work... eventually. You could get lucky and get the password in few hours, or it could take years, depending on the password length and complexity.