吗 and 吧 at the end of a question
Firstly, you are correct... both can be used at the end of a sentence, but they do not have the same meanings.

吗 ma = question particle 

吧 ba = suggestive particle

Here's some examples:

你还好吗？(Nǐ hái hǎo ma) Are you okay? 

你还好吧。(Nǐ hái hǎo ba) Come on, you're okay, right? (suggesting that they're okay)


Or, In many cases 吧 is in response to 吗:

Person A: 好吗？Okay?
Person B: 好吧。 Fine...


That girl said you should use ba because she thought you should be more suggestive 

我们一起吃饭吧！（Wǒmen yīqǐ chīfàn ba）sounds more assertive than 你想跟我一起吃饭吗？（Nǐ xiǎng gēn wǒ yīqǐ chīfàn ma?）