The new anime series Gate: Thus the JSDF fought there doesn't try to make swords versus tanks an even fight, instead it turns into a Curb Stomp Battle (TV Tropes). Tortoise-defense shieldwall versus 105/155mm artillery, ouch ouch ouch. Wyverns versus self-propelled anti-aircraft guns, same difference. The only battle in the early part of the story that comes close to even being considered a draw is Giant Flame Dragon versus Panzerfaust and that results in the dragon being driven off, not something the locals have ever seen happen before.
Itami, an 35-year old otaku fanboy desperately trying to get to a special event in the Ginza area of downtown Tokyo has his efforts thwarted by the appearance of a magical gate and an invasion of cod-Roman soldiers and armoured knights accompanied by wyverns and orcs intent on claiming this "new land" for their Empire. Itami helps get refugees away from the invaders and then organises the local police into an ad-hoc defensive line before soldiers from Japan Self Defence Force can get to the area. After that happens, see "Curb Stomp Battle" above. It turns out Itami is a second lieutenant in the JSDF, on leave for the day and he gets the usual reward for doing a good deed, he is promoted to first lieutenant and given more deeds to do...
The JSDF are sent through the Gate which has somehow remained in place even after the invaders were dealt with, to see what's on the other side, figure out how to stop another invasion happening and to arrest the people responsible for the first invasion and get them to pay reparations. Yes, really, arrest them and get them to cough up for the damage, mayhem and loss of life they have caused. It's Japan, deal with it.
What's in the other side of the Gate is the next invasion force, even bigger than the first one with the Empire's vassal states aligned with what's left of the original Empire's armies. Curb Stomp Battle no. 2 results although this time we get to see the battle from the Empire side of things, and it isn't pretty -- the Emperor has fed his vassal's armies into the grinder to prevent them rebelling after his own forces were beaten into a pulp, for one thing.
Now that the Gate has been secured the JSDF sends out reconnaissance patrols to find out the local situation and that's where Itami, our otaku hero comes back into the story, put in charge of a lightly-armed platoon and sent in search of catgirls, uh, intelligence about the indigenous peoples of this magical (literally) land. He doesn't find catgirls...
Gate is based on a manga which is itself written from a light novel series which is a toned-down expansion of a Japanese right-wing militaristic nutter's web novel. At each stage of reinterpretation the gore and violence and xenophobia has been de-emphasised and the fun parts (and there is a lot of humour in this series, sometimes incongruously bookending quite gory and horrific violence) brought more to the fore. Some folks think this anime series is actually underwritten by the JSDF itself as it paints a very rosy picture of their side of things generally. Even if they have I don't think it was someone in the JSDF Public Affairs division who came up with the concept of the grizzled old Top Sergeant shouting "The JSDF has a tradition of fighting monsters!" as they deploy to take on the Flame Dragon.