Neither, if you want relaibility, get a Lexus.
...and see how much normal maintenance is on them.
I don't know why nobody is willing to anwer the OP's question. He did not say "Which is better?" or "Is a BMW more reliable than a Lexus?". He had a very straight forward queestion - are both a 3 series and a 5 series equally reliable.
I would suggest the OP consult the data in Consumer Reports' surveys. According to CR, the normally aspirated versions of the three series mostly have average to above average reliabllity. The 5 series has been slighly less reliable, average to below average. My guess is that 5-series is typically spec'ed with more gizmos and features and thus tends to be more vulnerable to problems over time. Both cars will be more problematic in their forced induction forms.
Both the 3 and 5 will offer fairly expensive ownership experiences with routine maintance costs that are annoying. However, I don't think the reliablity gap between BMW and the Japanese makes is nearly as big as it is made out to be by some posters.
If you take it to a BMW dealer for service, and coming from a 2006 Honda Civic Si, you might begin to feel dizzy when you see your first BMW service invoice.
It's usually not cheap. I try to do my own basic maintenance.