Code of Civil Procedure Article 87

Upon entering a final judgment, the court shall, on its own initiative, decide the responsibility for litigation expenses. Where a superior court has reversed a lower court's judgment and entered a decision or changed the lower court's judgment, such superior court shall decide the responsibility for total litigation expenses. The same principle shall apply to cases where the lower court to which a case has been remanded or transferred is to enter a final judgment on that case.
中文原文 民事訴訟法第87條
法院為終局判決時,應依職權為訴訟費用之裁判。
上級法院廢棄下級法院之判決,而就該事件為裁判或變更下級法院之判決者,應為訴訟總費用之裁判;受發回或發交之法院為終局之判決者亦同。

English translation for reference only; the Chinese text prevails. Not legal advice.