I can think of a few that almost make the cut.
First one that comes to mind is Xenoblade chronicles X. Unfortunately the enviroment is mostly an alien planet, though there is a sci-fi city you can explore. Guns aren't the sole weapons you can use, but they're a major one. Wouldn't say it has much in the way of a "serious look" either.
Diverging more from JRPGs, Shadowrun games are set into a fantasy cyberpunk universe (basically cyberpunk with magic, orcs, elves, etc). Its technically a crpg but the games from what i've seen follow a fairly linear plot. And despite not having anime visuals, they do have a gritty-cartoon artstyle.
There's also Nier Automata, which has almost everything you want except for the fact you don't have guns but instead a robot that shoot projectiles.
Code Vein also comes to mind, since it has all these characteristics and you can use a bayonet as your main weapon.