Since this hit HNQ, I'll move this warning to the top to make sure everyone sees it: Do not buy more car than you can afford. Figure out how much you're willing to spend ahead of time—make sure you include tax/title/license fees, insurance, and a fund for emergency repairs—and don't go above that. Even if that means you can't get the luxury car, have to get a lower model, or have to buy it used, do not go above your budget.
Is ride quality better?
Yes, luxury cars are usually quieter on the inside, and generally have better suspensions for a smoother ride (or more responsive for high-performance sports cars).
They frequently have more powerful engines as well. That's nice while driving, but likely to be less fuel-efficient.
Is it safer?
Luxury cars frequently have more safety features—at least on base models—so they certainly can be safer, it's definitely something you should look into at least. Most of those are pre-collision (cameras, blind-spot and lane warnings, etc.), but some brands may have a side airbag in their luxury models that isn't there in the lower-end brand. I doubt there's much difference in crumple zones and whatnot beyond that, but you could look into it for specific models you're considering. Also, having the more powerful engine (as above) may occasionally get you out of the occasional risky situation, though depending on your driving style it may also get you into more.
Does it save money in long run?
No, you can pretty safely assume the opposite. Luxury models are quite likely to have higher ongoing costs even beyond the higher purchase price. Maybe some luxury models will need service less often, but the service is likely to be more expensive (parts certainly, labor may or may not be). They are likely to burn gas faster, and may recommend you use a more expensive higher octane gasoline. Insurance will probably be higher. More options and potentially worse warranties may close the gap a bit, and you can run the numbers if you want, but I'd be quite surprised if you found a luxury car for cheaper than its directly comparable base brand car.
It is possible for the lower-end luxury models to be less expensive than the higher-end base brand models, especially after adding in options. It's up to you to figure out whether that tradeoff is worth it for you.
Generally, the base models of luxury vehicles come with more features than the non-luxury siblings. Luxury cars potentially have features or options that aren't even available on the lower-end cars, but it's also possible for the base models to have features not available on the luxury equivalents.
Treatment at the dealership is another benefit. Luxury dealerships often have a nicer waiting area and more freebies (e.g. a selection of free snacks rather than just water and coffee), and are more likely to just give you a loaner car so you don't have to wait around in the first place.
Also keep in mind if your car is too expensive you may worry about it more, either in general or when you have to park in sketchier neighborhoods.
Finally, as Nicholas points out in a comment, it can serve as simply a status symbol, which may provide a psychological benefit—or open you up to less healthy competitive instincts.
So, in conclusion, while there isn't a pure financial reason to upgrade directly comparable cars, IF you can afford the difference there are comfort, convenience, psychological, and potentially safety factors to consider in your decision. Only you (and your spouse/life partner*, if applicable) can decide whether a luxury car is right for you.
*: Don't buy a car with someone you're not married to (or in a marriage-equivalent committed relationship where you won't be getting officially married for one reason or another), especially if you're planning to finance. It just gets messy. We get questions every week here from someone who got into trouble doing just that.