I have a working Automator Quick Action solution that you select the input images in the Finder, and then from Services menu, you run the Quick Action name. The service initially captures the original full path of the input files into a variable input_images, and then proceeds to copy them into the designated folder, where it converts them. The script then captures all the names of the converted images into another variable converted_images.
The Quick Action then retrieves these variables in order and feeds the entire collection of input and converted image names (in that order) as a single command line argument into a Run Shell Script action. I divert the input images to one Zsh array, and the converted images to another Zsh array. Then I use a nested loop to compare the basename of input file with its converted counterpart. When I have a match, I then apply the touch command and assign the original creation and modification date of the input file to its corresponding converted image name. I have tested this with five image files from different Finder locations, and the converted files bear the original creation and modification dates. Tested on Mojave 10.14.6.
The Quick Action has become more complicated to achieve this goal.
Replace the content of the Run Shell Script action with the following code:
#!/bin/zsh
# Note: There is one command-line argument of input followed by converted filenames
# count of all input and output files
typeset -i max=$#
typeset -i idx=0
let "idx = $# / 2"
# temporary array of combined input and converted image names
typeset -a temp=($@)
# slice temp array to get file categories. Zsh arrays are 1 based.
typeset -a input_images=("${(@)temp[1,idx]}")
let "idx++"
typeset -a convert_images=("${(@)temp[idx,max]}")
# now perform nested array comparison
for i in "${(@)input_images}";
do
for c in "${(@)convert_images}";
do
# compare input and converted basenames
[[ ! $i:t:r == $c:t:r ]] && continue
# names match so borrow creation/modication date
# from input filename and apply to output file.
/usr/bin/touch -r $i $c
# get another input filename
break
done
done
# print appended listing of input and converted filenames if arrays are non-zero in size
{ [ "${input_images[@]}" -eq 0 ] || printf 'input_images = %s\n' "${(@)input_images}";} >> ~/Desktop/foo.txt
{ [ "${convert_images[@]}" -eq 0 ] || printf 'converted_images = %s\n' "${(@)convert_images}";} >> ~/Desktop/foo.txt
exit 0