You cannot overwrite an XML template by creating a Button in Lua using the same name. Instead, to replace the texture, you would use the absolute name of the texture and modify that:
Code:
local texture1 = TotemFrameTotem1IconTexture
local texture2 = TotemFrameTotem2IconTexture
local texture3 = TotemFrameTotem3IconTexture
local texture4 = TotemFrameTotem4IconTexture
texture1:SetTexture(path_to_image)
texture2:SetTexture(path_to_image)
texture3:SetTexture(path_to_image)
texture4:SetTexture(path_to_image)