I think both of your options really work, you just need to understand the difference in philosophy. The Yamaha YZF-R3 is a sportbike - it's more aggressive in terms of riding position, the seat sits higher. The Kawasaki Ninja 400 is more neutral, more comfortable for longer rides. If you're planning to ride mostly around the city and learn, the Ninja might be more comfortable. But if you want to feel like a racer even at small engine sizes, the R3 will give you more of a feel for it.
In practice though, the main thing is to actually get on both of them and sit on them before you buy. When I was choosing, it seemed like I needed that sporty riding position, but then a couple hours behind the bars showed me that my back was getting tired and my legs were going numb. Now I'm glad I went with a compromise between style and comfort.
Honestly, for your first bike I'd actually look at something simpler: maybe a Yamaha YZF-R125 or similar small-displacement bikes. Yeah, less power, but maintenance and parts costs are way lower, and you're learning on any engine size anyway. The main thing is that the bike sits comfortably and doesn't require superhuman strength for maneuvers - that'll get annoying faster than lack of power will.