No. How would the compiler know they are the same?
What makes you think Math.max would be faster anyway? There is no reason it would perform faster than your function.
The compiler may well inline a simple function like that though - but that is down to the compiler.
Imagine how many libraries there are in a standard program. How much effort would the compiler need to go to to scan all those libraries for identical code fragments. Then see how tiny the gains from identifying them would be.
Now also consider the case of multiple libraries where both define this method. The compiler needs to leave both because otherwise one library becomes dependant on the other and what would happen if in the future one library changed or removed its definition of the method.
It's a huge messy can of worms for no real benefit in the end.