Buffalo advanced to its second AFC championship in five years after it held off a late rally by Lamar Jackson and the Ravens.