There's already another LuaTeX answer, but IMO it doesn't handle properly with locality and integer division. So here, and taking advantage of the fact Lua 5.3+ includes bitwise operators, a different approach using a binary GCD algorithm:
\documentclass{standalone}
%\usepackage{amsmath}
\usepackage{luacode}
\begin{luacode*}
userdata = userdata or {}
--https://xlinux.nist.gov/dads/HTML/binaryGCD.html
userdata.gcd = function (u,v)
--To handle with negative values
local u, v, g = math.abs(u), math.abs(v), 1
--Nice error message
assert(v~=0, "Denominator cannot be zero")
while u&1==0 and v&1==0 do
u=u>>1
v=v>>1
g=g<<1
end
while u>0 do
if u&1==0 then
u=u>>1
elseif v&1==0 then
v=v>>1
else
local t = math.abs(u-v)>>1
if u<v then v=t else u=t end
end
end
return v*g
end
userdata.simplified = function(u,v)
local gcd = userdata.gcd(u,v)
tex.sprint(("\frac{%d}{%d}")
:format(u//gcd, v//gcd))
end
\end{luacode*}
\newcommand\simplified[2]{\directlua{userdata.simplified(#1,#2)}}
\begin{document}
$\displaystyle\simplified{278922}{74088}$
\end{document}

The binary algorithm is slightly faster, but that's only noticeable when simplified fractions are extensively used in a document.