So I managed to get it working because of recommendation from DMGregory. Since sRGB is a readonly area, you need to create a rendertexture in code. Right here is my full code:
[SerializeField]
RenderTexture rt;
[SerializeField]
Digital camera cam;
[SerializeField]
string fileName;
[Button("Save png")]
public void SavePNG()
{
RenderTexture mRt = new RenderTexture(rt.width, rt.top, rt.depth, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB);
mRt.antiAliasing = rt.antiAliasing;
var tex = new Texture2D(mRt.width, mRt.top, TextureFormat.ARGB32, false);
cam.targetTexture = mRt;
cam.Render();
RenderTexture.energetic = mRt;
tex.ReadPixels(new Rect(0, 0, mRt.width, mRt.top), 0, 0);
tex.Apply();
var path = "Belongings/Textures/Rendered textures/" + fileName + ".png";
File.WriteAllBytes(path, tex.EncodeToPNG());
Debug.Log("Saved file to: " + path);
DestroyImmediate(tex);
cam.targetTexture = rt;
cam.Render();
RenderTexture.energetic = rt;
DestroyImmediate(mRt);
}