Yes, theoretically it's possible. The 6510 would be easiest since it's just a 6-bit I/o port mapped to $00 and $01. The 6509 is a little tougher because there are two ports (execution register and indirection register) plus two opcodes are modified. Those two ports control the processor BANK address lines. This means you need to monitor when those commands are executed in order to set the proper BANK. You can use the 6509 SYNC pin that tells you when the cpu is fetching an opcode, and if you see of the opcodes you set the bank lines properly. If you look on 6502.org you can find the datasheets for both CPU's. There is a block diagram in the 6509 datasheet that shows the additional function blocks.
Ultimately/eventually someone will have to build a replacement 6509 using an FPGA as machines break down and chips become impossible to find.
Steve