The use of death-traps far pre-dates films and TV series, dating back to novels and theatrical productions.
Take the Sherlock Holmes story The Adventure of the Engineer's Thumb [1892]. To quote from a wiki on the subject:
The engineer Victor Hatherley is trapped inside a hydraulic press
which would crush him to a pulp.
Escape method: a woman working for the
villains but not sharing their criminal ruthlessness opens a side
panel at the last moment, allowing Hatherley to escape
Or to go back even earlier, Edgar Allan Poe's The Pit and the Pendulum [1842]:
The unnamed character finds himself bound to a large slab, beneath a
bladed pendulum that slowly lowers toward him as it swings, with the
intention of slicing through his chest.
Escape method: The character
lures mice to the ropes with a piece of meat. They chew through the
ropes, allowing him to escape before the pendulum can slice him open.
As for when a death trap was first featured in film, the earliest I'm aware of is the Chained to a Railway trope, where a man or woman is tied to a railway line, certain to meet death - only to be saved in the nick of time. TV Tropes describes its history as:
This familiar scenario first appeared in the 1867 short story "Captain
Tom's Fright", although a more rudimentary form of it was seen on
stage in 1863 in the play The Engineer. However, it really entered the
meme pool as a result of its inclusion in the 1867 play Under the
Gaslight, by Augustin Daly. (Interestingly, in Gaslight the victim is
a male, not a fair maiden) By 1868, it reportedly could be found in
five different London plays all running at the same time, and remained
a theatre staple for decades. The earliest known use of this trope in
movies was the 1913 Keystone Komedy film Barney Oldfield's Race for a
Life, where it was played for comedy.
Interestingly, the Under the Gaslight play example above actually features a man is tied up, being rescued by a woman (not the typical "damsel in distress" trope).
Now, it's generally considered a myth that the "chained to a railway" track was a major plot device in most silent films. The majority of examples of this tend to occur in comedies. However, even though the examples I've listed are comedies, they are still examples and I hope they'll suffice.
Finally I am aware that the above has a critical flaw compared to what you're asking for - the first films I've mentioned features the damsel in distress in the death trap, not the hero. However, as this trope pre-dates film by some way, I don't believe it would be a trivial task to find the absolute first film or series to show this, as it wasn't ground-breaking or particularly noteworthy. This trope had been in existence for decades before films were mainstream.