Easiest solution for Windows users, confirmed working as of June 2019.

Download the ASUS Firmware Restoration Tool but don't open it yet ( Recommended version

Unplug your computer from the router

Put the router into Rescue Mode by: turning the power off, using a pin to press and hold the reset button, then turning the router back on while keeping the reset button pressed for ~5 secs until the power LED starts flashing slowly (which indicates the router has entered Rescue Mode)

Important (if you don't do this next step the Asus Firmware Restoration Tool will wrongly assume that the router is not in Rescue Mode and will refuse to flash it): go to the Windows Control Panel and temporarily disable ALL other network adapters except the one you will use to connect your computer to the router

For the single adapter you left enabled, temporarily give it the static IP 192.168.1.10 and the subnet mask 255.255.255.0

Connect a LAN cable between your computer (make sure to use the Ethernet port of the adapter you've just set up) and port 1 of the router (not the router's WAN port)

Rename openwrt-XX.XX.X-ramips-mt7620-rt-ac51u-squashfs-sysupgrade.bin to factory.trx

Open the Asus Firmware Restoration Tool, locate factory.trx and click upload (if Windows shows a compatibility prompt, confirm that the tool worked fine)

Flashing and reboot is finished when the power LED stops blinking and stays on