short answer: both are the same words but in different diacritics(tashkeel) تشكيل
detailed answer:
both words are the same "Rabb" (رب) but you add different diacritics(A َ, O ُ, E ِ )(tashkeel) تشكيل according to the word position and meaning inside the phrase as the grammar (Nahw) rules says
there are a lot of Nahw rules that governs you how to add the diacritics to the words - in fact this is the heart and sole of the Nahw rules -
to give you an example let us take the word (brother - أخ - Akh - a5) , and put it in different situations in different phrases to see how some Nahw rules apply to the same word and change it to the three different diacritics(A َ, O ُ, E ِ ) , and I will try to bring the most common rules and situations
1- (a - Fatha فتحه - Aَ )
the most common situation you put Fatha on the word, if it appears in the sentence as object
(مفعول به - mafoul beh)
example: I thanked the brother - شكرت الأخَ - shakarto Al-Akh(a)
when the word appears as an object you mostly are going to add (a) to it [1] see notes at the end
2- (o - dammah ضمة - oُ )
the most common situation you put damma on the word, if it appears in the sentence as subject
(فاعل - fa`el)
example: the brother came - جاء الأخُ - jaa' Al-Akh(o)
when the word appears as an subject you mostly are going to add (o) to it [1] see notes at the end
3- (e - kasrah كسرة- eِ )
the most common situation you put kasrah on the word, when the word come in the sentence after some of the letters of jarr(حروف الجر) (like the letter L "ل") as in Lellah - لله in verse [2:284]
NOTE- 1 : the Nahw book says the situations I mentioned enforce you to change the word according to the type of word(Singular, plurals, ..etc) (some situations you will add ( diacritics - tashkeel - تشكيل ) like we did in example 1 for the Fatha , and some situations you add letters like( a ا , o و , e ي ), although you pronounce them the same most of the situations , but I had to note that.
for more information look at https://en.wikipedia.org/wiki/Arabic_diacritics
regarding your example Alhamdu lillahi Rabbil Alamin , you add kasrah
rabb(i)alalamin because it had the letter L ل before the word (li)llahi, which is another rule, and in duaa , I say (ya rabbi) meanning my god , and you can pronounce ya rabb(a)lalamin