I am mindful of an episode of Star Trek, featuring James T Kirk, that thinking about it has some striking similarities to the pursuit and eventual destruction of the Bismarck.

I cannot recall the episode precisely, but I'm sure other members of this forum can, it involved a rogue ship attacking a Federation outpost with some sort of super weapon. The Enterprise finds, tracks and chases this ship and eventually comes under fire from this super weapon. In trying to dodge this super weapon Kirk discovers that longer ranges reduce the effect of the weapon so that the Enterprises's shields can deal with it. Eventually the enemy ship is degraded and disabled by phasers.

Recall the episode anybody?

Was the episode in any way inspired by Rheinubung and the hunt for Bismarck?

I believe that was the episode called The Balance of Terror." Mark Lenard, who went on to play Spock's father in subsequent episodes and in movies, was the commander of the Romulan ship which attacked the outposts along the neutral zone. With a very powerful plasma weapon and the ability to remain invisible except when firing, the Romulan ship is a serious challenge to the nominally faster Enterprise. The writers of the episode drew heavily on the movie The Enemy Below (Robert Mitchum and Curt Jurgens).

Their shoulders held the sky suspended;They stood and Earth's foundations stay;What God abandoned these defended;And saved the sum of things for pay.