TOKYO — Japan’s ruling coalition appeared headed to an impressive win in national elections on Sunday, in what would represent an endorsement for Prime Minister Shinzo Abe’s nearly five-year leadership. A victory would boost Abe’s chances of winning another three-year term next September as leader of the Liberal Democratic Party. That could extend his premiership to 2021, giving him more time to try to win a reluctant public over to his longtime goal of revising Japan’s pacifist constitution. In the immediate term, a victory likely means a continuation of the policies Abe has pursued in the nearly five years since he took office in December 2012 — a hard line on North Korea, close ties with Washington, including defense, as well as a super-loose monetary policy and push for nuclear energy. Japanese media projected shortly after polls closed that Abe’s LDP and its junior partner Komeito might even retain their two-thirds majority in the lower house of parliament. In unofficial results in the early hours of Monday, the ruling coalition had won 312 seats in the 465-seat lower house, exceeding a two-thirds majority at 310, and other parties had 143 seats, Japanese public broadcaster NHK said.