Beginners are often told to focus on power, but honestly the main thing is handling and weight. Both Yamaha and Kawasaki from your list get this right: both bikes are light (around 170 kg) and affordable, so if you crash, you won't break the bank replacing parts.
But here's what a lot of people forget to mention: the riding position on these bikes is totally different, and it affects everything. The R3 is a proper sportbike with an aggressive forward lean and your legs tucked in. Some people are fine with that, but others find it uncomfortable on longer rides and when parking - your feet are further from the ground. The Ninja 400 keeps your back more upright, and it's easier to touch down your feet on the pavement when you stop. That matters a lot at first, especially if you're not that tall or you get nervous at traffic lights.
Also worth checking out are the Honda CB125R or even CB250R - they'll feel more planted if you're planning to ride beyond just the city. Or the Suzuki GSX-R125 if you want a sportbike like the R3 but a bit cheaper. Anyway, go to a dealer and sit on both of them - that'll tell you more than any advice on the internet.