I have found a workaround, with no need to change the security settings on my Mac with OS 15.4. At least it worked for me.
I think it is important to tell you that I have loads of .srt files for my business (I am in video production and use .srt subtitles normally and frequently) and I generally open them with TextEdit.
I, too, have received two .srt files that generate the same problem described by the OP. And the difference with other .srt files lies in the fact that the other files are not considered malware.
I tried to open both with Microsoft Word, which is not a recommended application.
I did not proceed when Word asked me to convert the files and canceled the routine.
Then I reopened the .srt files and the warning message was not shown.
I can read them with TextEdit and they are not damaged in any way.
I have no idea how Microsoft Word was able to override the security warning and, in any case, I had checked the files for malware and there was none.
But, hey, at least I do not have to go through the annoying process of "opening anyway".