Moves
Swords Dance raises Mega Lucario's Attack by two stages, making it harder for foes to switch into its attacks.
Meteor Mash is Mega Lucario's most reliable Steel-type attack, dishing out heavy damage to common Fairy-types such as Xerneas and Arceus-Fairy, and is Lucario's most effective way of dishing out damage to Mega Salamence, Rayquaza, and Arceus-Flying. It is also Lucario's only means of hitting common Ghost-types such as Marshadow, Mega Gengar, and both Giratina formes.
Close Combat is Mega Lucario's most reliable Fighting-type attack and most powerful commonly ran STAB move, OHKOing Yveltal after Stealth Rock damage, Ferrothorn, and opposing Mega Lucario. Close Combat also 2HKOes many common threats such as Primal Groudon after Stealth Rock damage, Necrozma-DM, Primal Kyogre, and Magearna.
Bullet Punch allows Mega Lucario to revenge kill faster, weakened foes and is especially useful for dealing with +2 Xerneas, as it does up to 50% to it.
Stone Edge allows Mega Lucario to KO Ho-Oh, which otherwise resists Lucario's STAB moves.
Earthquake can be used to deal more damage to Toxapex and to dish out heavy damage to some Steel-types without having to deal with defense drops, but it doesn't really serve any other purpose and Lucario doesn't appreciate giving up any of its other moves.
Ice Punch can be used to deal with Zygarde-C, which otherwise walls Mega Lucario, and it also does heavy damage to Mega Salamence, but Lucario doesn't appreciate losing any of its other moves.
Set Details
Justified is Mega Lucario's best ability to run prior to Mega Evolution, giving it an Attack raise if it switches into a Dark-type attack.
Lucarionite is required in order for Lucario to Mega Evolve.
Maximum Speed investment and a Jolly nature allows Mega Lucario to take advantage of its Speed tier, allowing it to outpace foes such as Timid Yveltal and Adamant Mega Salamence.
Maximum Attack investment results in the best possible damage output.
An Adamant nature can be a nice option if Lucario is used on Sticky Web teams, as it outspeeds every grounded foe in the tier if Sticky Web is up, and an Adamant nature enables it to OHKO Zygarde pre-transformation at +2 with Close Combat and potentially 2HKO Giratina-O with Meteor Mash.
Usage Tips
Against offensive teams, it is often better to simply attack what's in front of Lucario, as offensive teams tend to run more frail Pokemon, and Lucario should be used more late-game, once everything has been weakened down to the point where Lucario does not need to set up in the first place.
Lucario has rather mediocre bulk, so avoid bringing it in directly on attacks. Instead, bring it in by U-turn from partners such as Yveltal, double switching, or sacrificing a weakened partner.
Despite the fact that Lucario gets an Attack raise if it switches in on a Dark-type attack prior to Mega Evolution thanks to its ability Justified, Lucario should avoid switching into Dark-type Pokemon, as it is 2HKOed by Dark Pulse from offensive Yveltal and Foul Play from defensive sets, and, while Arceus-Dark and Mega Sableye have significantly less damage output, both of them run Will-O-Wisp, which can render Lucario almost useless if it switches into it.
Swords Dance is best used against bulkier teams where Lucario is going to take minimal damage if the opponent chooses not to switch out. Examples of setup targets are Celesteela, Chansey, Blissey, and Ferrothorn.
Team Options
Mega Lucario tends to fit best on hyper offensive Sticky Web teams, as it outpaces every grounded foe in the tier if Sticky Web is on the field, thus making it less prone to being revenge killed. Therefore, it appreciates having Sticky Web setters such as Smeargle and Shuckle.
Yveltal makes an excellent partner, as it deals with Mega Gengar, Marshadow, and Lugia. Yveltal also appreciates Mega Lucario's ability to threaten Xerneas, Arceus Fairy, and special walls such as Chansey and Blissey.
Primal Groudon is a brilliant partner for Mega Lucario, as it sets up Stealth Rock, which weakens opposing Pokemon and makes it easier for Mega Lucario to sweep late-game. This is especially useful for dealing with Ho-Oh and Lugia, as Ho-Oh's HP is reduced by 50% if it switches in when Stealth Rock is on the field, and Lugia's ability to check Mega Lucario is reduced if its Multiscale is broken. Primal Groudon also provides teams with a primary check to Xerneas, which means that Mega Lucario either doesn't have to deal with it at all or has an easier time revenge killing it with Bullet Punch. Furthermore, Primal Groudon is able to easily deal with Toxapex, beat Marshadow one-on-one, and KO Ho-Oh if it opts to run a Rock-type attack.
Primal Kyogre is a useful partner for Mega Lucario, as it threatens physically defensive Primal Groudon, Zygarde-C, Arceus-Ground, and Ho-Oh, all of which either outspeed Mega Lucario or have enough natural bulk to be able to survive a +2 Close Combat. Primal Kyogre also appreciates Mega Lucario's ability to break through many of its defensive checks such as Chansey, Blissey, and Ferrothorn.
Xerneas has brilliant offensive synergy with Mega Lucario, as it is able to easily break through teams and deal with foes such as Yveltal, Zygarde-C, and Marshadow. Choice Scarf sets can also act as a cleric, removing burns or curing paralysis on Mega Lucario. Xerneas also appreciates Mega Lucario's ability to break through or weaken many of Xerneas's checks such as Necrozma-DM, Ferrothorn, Primal Groudon, Chansey, and Blissey.