All three words mean to do something--usually to speak--in a way that is designed to be impressive, and they all carry the connotation that the thing added is not of real value; that it's just for show. The difference is in what is added.
With bombast the speaker adds something big and showy. Think of a popular preacher; loud, self-satisfied, and full of his own importance. This is more likely to be used when the speaker is puffing up his or her religion, or politics, or patriotism.
With grandiloquent the speaker adds something elaborate or complicated. Think of a diplomat standing in front of a bored audience giving a long speech full of complicated metaphors. This is usually going to be a highly formal speech, often too formal for the occasion (or for any occasion).
Bombastic and grandiloquent are close enough in meaning that they can be used almost interchangeably. There is, however, a difference in implication. A bombastic speech is more likely to be loud and aggressive; a grandiloquent speech to be formal and academic. But like I say, this is not a hard and fast rule, just a mild implication.
With ostentatious the speaker is showing off. This is similar to "bombast," but "ostentatious" is more often used for actions rather than speech. For example, if you drive your Ferrari up to the restaurant, walk past the valet and into the restaurant, and hand the waiter your keys, saying loudly, "Have someone take good care of my very expensive Ferrari!" you are being ostenatious. Most often, this is used to describe someone who is showing off their money.
A good example of a bombastic, grandiloquent speech is the Reverend Chadband in Dickens' Bleak House. Here is is first speech, on arriving at a family dinner.
“My friends,” says Mr Chadband, “peace be on this house! On the master thereof, on the mistress thereof, on the young maidens, and on the young men! My friends, why do I wish for peace? What is peace? Is it war? No. Is it strife? No. Is it lovely, and gentle, and beautiful, and pleasant, and serene, and joyful? Oh, yes! Therefore, my friends, I wish for peace, upon you and upon yours.”
This is a good example of "grandiloquent." It's overly flowery, overly elaborate, for the occasion, saying something in a hundred words that could easily be said in five.
Here is a later speech by him to the same dinner-party that would more likely be described as bombastic:
"It is," says Chadband, "the ray of rays, the sun of suns, the moon of moons, the star of stars. It is the light of Terewth."
Mr. Chadband draws himself up again and looks triumphantly at Mr. Snagsby as if he would be glad to know how he feels after that.
"Of Terewth," says Mr. Chadband, hitting him again. "Say not to me that it is NOT the lamp of lamps. I say to you it is. I say to you, a million of times over, it is. It is! I say to you that I will proclaim it to you, whether you like it or not; nay, that the less you like it, the more I will proclaim it to you. With a speaking-trumpet! I say to you that if you rear yourself against it, you shall fall, you shall be bruised, you shall be battered, you shall be flawed, you shall be smashed."
This is still grandiloquent, still over-elaborate, but it also has that bullying, over-the-top quality that is often associated with "bombast."