What is English counterpart to Japanese phrase, “往生際が悪い” – behave disgracefully toward the end of life?
I would suggest the person is a poor (or sore, or bad) loser
poor loser
: a person who becomes upset or angry when he or she loses
Merriam Webster
For example, here's a recent usage regarding the American presidential election:
'Trump looking like a poor loser' as US President begins legal battle against Biden voters
(Special note: In Japanese the phrase doesn't mean "death" but "brink of death," and the usage has been extended metaphorically; the reference to "death" here has no more literal application than does "skinning a cat" have in the phrase "more than one way to skin a cat." See 往生際.)
One English word that describes someone who does not admit their wrongdoings is unrepentant. The Oxford English Dictionary defines the word thus:
Feeling or evincing no regret for one’s wrongdoings; impenitent. Now also more generally: not sorry for any action or behaviour, unapologetic.
The word is not restricted to referring to one's attitude at death. That said, the word is sometimes used to refer to people who do not repent from their wrongdoing before death or the Last Judgment, especially in a Christian context. The OED has several examples of unrepentant used in the face of death:
Bible (Wycliffite, E.V.) (Douce 369(2)) (1850) Rom. ii. 5 Aftir thi hardnesse and vnrepentaunt [L. impaenitens] herte, thou tresourist to thee wraththe in to the day of wraththe. [Translation: Befitting your hardness and unrepentant heart, you store up wrath to yourself for the day of wrath.]
c1450 Jacob's Well (1900) 9 In þis cursyng, who-so deye vnrepentaunt, schal haue a dredeful ende! [Translation: In this cursing, whoever dies unrepentant shall have a dreadful end!]
1796 W. Cole Contradiction 144 May I die unrepentant and unforgiven, if my humiliation come not from my heart; if my contrition be not sincere!
Today, it is very common to see unrepentant describing someone who is very obviously bad: two of the top collocations for unrepentant with a noun are unrepentant sinner and unrepentant terrorist. Otherwise, unrepentant is frequently used as a predicate adjective describing the subject of the sentence, as the first results from a COCA search show (Corpus of Contemporary American English):
The prodigal is allowed to return even if unrepentant.
Buchanan as ever was unrepentant about his and his wife's aim.
Ledstone was quite unrepentant about his grandfather.
I would call that person a bad sport or a poor sport (in addition to acting like a sore loser).
poor/bad sport : a person who is rude or angry about losing
It is the opposite of showing good sportsmanship. An example used in social-emotional learning here: "It's always upsetting to see your child behave like a bad sport."