Both balls expand when heated, but the center of gravity of the ball on the plane rises as it expands, and the center of gravity of the suspended ball lowers. For the ball on the plane, part of the 100 joules is converted to gravitational potential energy, and less than 100 joules of energy is actually used to warm the ball. Therefore the temperature of the suspended ball changes more.