Avila provided all three Detroit runs and Prince Fielder went 3-for-4 as the Tigers took the rubber match of a three-game set.
Tigers starter Max Scherzer fell short of a 20th win for the fourth straight outing, settling for seven innings of one-run ball with a season high-tying 12 strikeouts.
Drew Smyly (6-0) instead earned the decision and Joaquin Benoit racked up his 20th save as Detroit shrank its magic number to win the American League Central to nine.
Jeremy Guthrie (14-11) was hung with the complete-game loss, allowing three runs on 13 hits.
Alex Gordon homered for the Royals, whose AL wild card playoff hopes took a hit.
Sign language interpreter at Mandela service called out as fake on Twitter
Puzzle-maker slips 'Murdoch Is Evil' into Rupert Murdoch's Sunday Telegraph