This can be solved by creating a system of equations.
x + y = 254
12.5x + 10y = 2745
We can then use substitution to solve the system.
x = 254 - y
12.5(254-y) + 10y = 2745
3175 - 12.5y + 10y = 2745
-2.5y = -430
y = 172
Finally, we can use that answer to solve for x.
x + 172 = 254
x = 82
So, there were 82 of the lower box tickets sold and 172 of the upper box tickets sold.