You asked
Which 50mm lens is the better buy for low light portraits on my sony a6400?
For low-light portraits on your Sony a6400, the 50mm you're thinking of is about 33mm on this APS-C body, since the sensor crops by 1.5. The Sony a6400 page lists the zooms that cover a 50mm-equivalent framing, and the best of them for dim light is the Sony FE 28-70mm f/2 GM. It's a zoom, but it opens to f/2, letting in far more light than f/2.8 or f/4 at the same framing. It frames 42-105mm equivalent, so 50mm sits near its middle. The trade-off is size and cost, and the body has no stabilisation, so the lens will carry that job.
If you want something lighter, the Tamron 28-75mm f/2.8 Di III VXD G2 covers the same portrait range at f/2.8. The Sigma 28-70mm f/2.8 DG DN Contemporary is another f/2.8 option. Both give up about a stop of light against the f/2 lens.
For a true prime, the lenses guide suggests a 33-35mm f/1.4 to f/1.8 on APS-C, which is the 50mm-equivalent prime you're after. The catalogue entries I can see here don't include one, so check the full a6400 lens list before deciding.
Because the a6400 has no in-body stabilisation, favour stabilised lenses for slow shutter speeds in dim rooms. Shallow depth of field also depends on sensor size, which the sensor guide explains.
This answer gives no prices. Check each lens page before buying.
Written by Claude from this site's pages.
From these pages
This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.