While there is nothing wrong with either of the cameras you mention as hiking companions, I suggest that instead you go with a small, lightweight compact digital camera with a decent zoom lens. Unlike the ones you mentioned (or similar models), the compact camera can fit into a pants pocket; that keeps it out of your way until you need it, and offers a bit more protection than having it hang in front of your chest on a neck strap. A compact camera is going to be lighter, too -- you know how important that can be when you're hiking. It will also cost a lot less, unless you go for a high-end compact (which can cost much more than either of the two you're looking at); if you bang it on a rock, it won't hurt your pocketbook as much.
Which particular camera you should get depends on your particular requirements and budget; if you hike in mountains you might want a superzoom camera that will let you grab shots at considerable distance, but otherwise one with a 3x or 4x zoom might be a better choice. If you take really long hikes or otherwise will be away from AC for recharging, you might consider a camera that takes AA batteries (alkaline or rechargeable) instead of a proprietary battery, and carry spares.
The downside to most affordable compact digitals is that you have even less control over exposures than with a beginner-level DSLR (like the D3400) or MILC (like the EOS M3). At the same time, both these cameras are really designed to do most of the work for you, making them only a little more versatile than a compact camera. This is especially true if you use the "kit" lenses that typically come with them.
A more expensive camera won't make you a better photographer, and the extra "fuss factor" may actually get in your way. Taking lots of pictures *will* improve your skills, even with a simple point-and-shoot camera.
But if you really want one of the two in your post, go with the Nikon D3400. It has the look-and-feel you're probably craving, and the range of lenses available is enormous. A good lens is more important to most serious photographers than a more-expensive camera body; and the lenses you buy for the D3400 will fit other Nikon DSLRs with the APS-C image sensor format, if/when you're ready to upgrade.