That’s a tricky one; beets is pretty hard-coded to preserve extensions when moving files rather than regenerating them. (That’s not necessarily wise, but it does avoid other potential problems with unexpected changes to extensions.)
Fixing this might require some manner of nuclear option. The easiest might be to remove these files from your library, rename them, and then beet import -A them to get them back in. A more advanced version could involve modifying the underlying database directly, but that seems like more trouble than it’s worth…
You could loop across the filenames to rename and update the database accordingly, for example in bash:
# read all filenames into an array
IFS=$'\n' mapfile -t files < <(beet ls -p format:mp3 "path::m4a$")
# move and update
for bad_file in "${files[@]}"; do good_file=${bad_file%.m4a}.mp3; mv -i "$bad_file" "$good_file" && beet modify -y "path::$bad_file" "path=$good_file"; done
mv will prompt you before each operation, - the database won’t get updated if you choose not to move the file.
If you’re completely sure that you want to process all of them, you can remove the -i flag.