how could two objects have the same temperature but different thermal energy?
Thermal energy is dependent on the mass. If objects have a different mass then they will have a different thermal energies.
YOU can think of energy as the movements of molecules an object. Lets say there is a cup of coffee, boiling. Molecules are moving FAST, awesomely Mass movements of molecules. But there might be a huge iceberg. There is huge more amounts of molecules than the coffee, making it have more thermal energy even if there might more movements of molecules but it does not add up to the billions of molecules count of the iceberg.