All you need is a 3 or 4 step action:
- Image > Trim... (optional step)
- File > Automate > Fit Image...
- Image > Canvas Size...
- Layer > Flatten Image

Refer to the previous links for some finer points on setting up such an action.
If you use File > Automate > Batch to run the action, you would need to add a file-saving step to the action.
If you use Image Processor (installed in Photoshop by default) or Image Processor Pro (optional add-on) or Picture Processor Pro (optional add-on) scripts, then there is no need to include the save step as the script takes care of the file saving.
"If you use File > Automate > Batch to run the action, you would need to add a file-saving step to the action."
"I need to keep the image titles the same. "
To recordd this step just do not touch file name field while recording action in order to keep existing file name and to avoid overwriting in batch process. It is better to use Image Processor Pro without need for Save step.