Of course, there is a difference between png and jpeg format. PNG supports lossless data compression, whereas JPEG uses always a lossy compression. Therefore the same image can become numerically different, if we save it in a different format.
Example:
We assume the following png image (make sure to download it, to reproduce this example). We will save this image as jpg and then we will compare the png image with the jpg image:
https://upload.wikimedia.org/wikipedia/commons/6/6c/Belton_Garden.png

Code:
import cv2
import numpy as np
img = cv2.imread('./Belton_Garden.png', -1)
img_png = img
cv2.imwrite('./Belton_Garden.jpg', img)
img_jpg = cv2.imread('./Belton_Garden.jpg', -1)
diff = img_png - img_jpg
cv2.imwrite('diff.png', diff)
print('diff', diff)
The difference of the png and the jpg image looks like this:

Conclusion:
Will different image formats (jpg, png) affect the training results of
Mask-RCNN?
As you can see, it may affect your results. For this reason, it is a good idea to be consistent with the image format, to remove this source of error.