Lossless convert 3gp video to mp4 using ffmpeg
If the codecs of your input file are already h264 and aac for video and audio, respectively, you can just copy without decoding and encoding again.
ffmpeg -i input.3gp -c:v copy -c:a copy output.mp4

The options -c:v copy and -c:a copy indicate video and audio won't be encoded again, respectively. If audio format in the input cannot be embedded to the output, you need to omit -c:a copy from above command.
If you need to encode again, an option -qscale 0 will result similar quality (but not lossless).
below is an example.
You might combine with -c:v copy or -c:a copy if you don't need to encode video or audio again.
ffmpeg -i input.3gp -qscale 0 output.mp4