How to know when to bleed a hydraulic disk brake / tips for improving disk brake performance?
Bad disc brake performance is almost always either air in the lines or oil on the pads.

Air makes the levers spongey and oil stops the pads grabbing the disc.

Your problem sounds like air, a bleed should sort it out. A bad bleed from the factory is not that uncommon.

If you've patience you can try turning the bike so the line is as vertical as possible and gently tap the calliper, line and lever to see if you can convince the bubble into the reservoir, this is a temporary fix but will confirm that the problem is air.

An oily pad will feel firm if you pull the lever but will not grab the disc when you're riding. They often feel just fine if you push the bike with no weight on it.

To test this you could pull out the front pads and see if they work better, be sure the clean the disc with some alcohol first.

The easiest way to fix dirty pads is to buy new ones.

Brakes that are not run in properly feel like oily ones, just not to the same extent, and are easily fixed by following the run in procedure in your manual. This is usually getting up to speed and stopping as hard as you can 5 or 10 times.