If you are on Windows, and if there are no additional dots in any of the file names, then you can use the following:
ren *.txt.jpg ???????????????????????????????????????????????????.jpg
There must be enough ? to match the length of the longest file name. See How does the Windows RENAME command interpret wildcards? for more info.
If some files have more than two dots, then you will need more than a simple REN command. The following should remove the unwanted .txt regardless how many dots are in the original name.
for %A in (*.txt.jpg) do @for %B in ("%~nA") do @ren "%A" "%~nB.jpg"
If you put the command within a batch script then you must double the percents:
@echo off
for %%A in (*.txt.jpg) do for %%B in ("%%~nA") do ren "%%A" "%%~nB.jpg"