There is no route table inside lwIP. About the out packet, lwIP will search the interface according to ip addr/mask of each ethernet interface. If no result, the packet will be sent to the default interface.
Therefore, please let the two interfaces in different sub-network, for example,
If these two interfaces are in same sub-network, lwIP is wondering which one is the correct one and then only send to the first one.
If you want to use the packet forward function simply from one interface to another interface, you can look at the lwIP NAT implementation in RT-Thread RTOS: