The IF function has no control over how the Max function evaluates. It only controls whethter or not it evaluates at all. If the first related record in Maintenance Log is not an oil change entery, you will get a blank field as the first part of the expression can only look at the first related record and in this case, the If function will prevent the max function from evaluating.
The Max function can only return the maximum value for all related records, it doesn't have any options to make this selective.
You have three options that I can think of:
Use a relationship that matches only to Oil change records for a given vehicle. Then Max will work for you.
Use a summary field "maximum of" Mileage defined in the Maintentance Log table, but place it inside a one row portal with a portal filter set to exclude all records that are not oil change records. (You have to have FileMaker version 11 for this option.)
Set up a report layout based on the Maintenance Log instead of the Vehicle table. Then you can use Finds and Sorts to list such entries not only for an oil change but for any other maintenance activities where you want to see the mileage.
The summary field worked. Thank you!