Rule 1: 1. Ordinals in running text
In a story the ordinals do what every adjective does: they follow their noun and take its gender, case and article. Two idioms are worth fixing: لِلْمَرَّةِ الْأُولَى for the first time and مَرَّةً ثَانِيَةً a second time, again.
دَعَا الْمُفَتِّشُ التِّلْمِيذَ الْأَوَّلَ ثُمَّ التِّلْمِيذَ الثَّانِيَ.
daʿa-l-mufattishu-t-tilmīdha-l-awwala thumma-t-tilmīdha-th-thāniya
The inspector called the first pupil and then the second pupil.
Accusative ordinals.
كَتَبَ الرَّجُلُ اسْمَهُ لِلْمَرَّةِ الْأُولَى فِي حَيَاتِهِ.
kataba-r-rajulu-smahu li-l-marrati-l-ūlā fī ḥayātihi
The man wrote his name for the first time in his life.
جَاءَ الْمُفَتِّشُ فِي الشَّهْرِ الثَّالِثِ وَرَجَعَ مَرَّةً ثَانِيَةً فِي الشَّهْرِ السَّادِسِ.
jāʾa-l-mufattishu fi-sh-shahri-th-thālithi wa-rajaʿa marratan thāniyatan fi-sh-shahri-s-sādisi
The inspector came in the third month and came back a second time in the sixth month.