In general, the pronounciation at the end of any sentence should be silent (Not Osta-tha-tan, but rather Osta-tha). Also, it is uncommon (or informal) to use "kayfika" in formal Arabic, the common greeting is "Kay-fal Hal" (كَيْفَ الحَال)
Ma'am is not equivalent to "Osta-tha", as it is misguiding. "Say-ye-da-tee" (سَيِّدَتِي) for Ma'am or "Aa-ni-sa" (آنِسَة) for Miss.
"How are you, teacher?" Should be: "كَيْفَ الحَالُ يَا أُسْتَاذَة؟" "How are you, ma'am?" Should be: " كَيْفَ الحَالُ يَا سَيِّدَتِي؟"
اسْتاذة should be known as professor or teacher. It is not the word for Ma'am