The "If this card attacks, it is unaffected by other cards' effects until the end of the Damage Step." effect is a Continuous Effect. (It is applied when either this card attacks a monster, or when this card attacks directly.)
After the effect of "Spiritual Beast Apelio" is applied, this card will have 3100 ATK and 900 DEF. If this card attacks, this card's effect is applied, and it will have 2600 ATK and 400 DEF. After that, when you return to the Battle Step, this card is affected by the effect of "Spiritual Beast Apelio" again, and it will have 3100 ATK and 900 DEF.