Both the TGZ and RAR are compressed archives, just featuring different compression method. If needed, these archives can be simply repacked with any program that supports both TGZ and RAR format. You can also do it using two archivers if yours doesn't support both formats and first manually extract and then compress the data again.
Open TGZ file Open RAR file